Skip to content

Instantly share code, notes, and snippets.

@hernandev
Created August 24, 2016 16:07
Show Gist options
  • Save hernandev/cecc44dd219b80ac4e18c3ef2b2cb730 to your computer and use it in GitHub Desktop.
Save hernandev/cecc44dd219b80ac4e18c3ef2b2cb730 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