Skip to content

Instantly share code, notes, and snippets.

@cpereiraweb
Forked from hernandev/site_do_nginx.conf
Created December 27, 2016 17:41
Show Gist options
  • Save cpereiraweb/8aa2ad1a98efd71ad720ba16b465fa50 to your computer and use it in GitHub Desktop.
Save cpereiraweb/8aa2ad1a98efd71ad720ba16b465fa50 to your computer and use it in GitHub Desktop.
# HTTP Application
server {
# Application Path
root /path/to/app/public/path;
# Index Application File
index index.php;
# Listen to hosts
server_name app.com www.app.com *.app.com;
# Enable IPv4
listen 80;
# Enable IPv6
listen [::]:80;
# URL Rewrite Rules
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# PHP Backend Config
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm-myapp.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment