Skip to content

Instantly share code, notes, and snippets.

@shrekuu
Last active October 27, 2017 07:57
Show Gist options
  • Save shrekuu/bcc0f799377193117d855793a05fcb7e to your computer and use it in GitHub Desktop.
Save shrekuu/bcc0f799377193117d855793a05fcb7e to your computer and use it in GitHub Desktop.
nginx server config example
server {
listen 80;
index index.php index.html index.htm;
root /var/www/example/public/;
server_name example.com;
location ^~ /api {
try_files $uri /index.php?$query_string;
}
location / {
alias /var/www/example-angular/dist/;
try_files $uri $uri/ /index.html;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment