Skip to content

Instantly share code, notes, and snippets.

@xuyuji9000
Created April 28, 2017 09:00
Show Gist options
  • Save xuyuji9000/1461fe0fedf198f17008c906853bc3cc to your computer and use it in GitHub Desktop.
Save xuyuji9000/1461fe0fedf198f17008c906853bc3cc to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name localhost;
root [directory_path]/public;
index index.php
location / {
try_files $uri $uri/ /index.html;
if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; }
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment