Skip to content

Instantly share code, notes, and snippets.

@henter
Created July 6, 2015 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henter/6fe995660b9154d977e1 to your computer and use it in GitHub Desktop.
Save henter/6fe995660b9154d977e1 to your computer and use it in GitHub Desktop.
nginx conf
server {
listen 80;
server_name xxx.com;
root /var/www/xxx/;
error_log /var/log/nginx/xxx.error.log;
access_log /var/log/nginx/xxx.access.log;
location / {
index index.php;
try_files $uri $uri/ @rewriteapp;
}
location @rewriteapp {
#for symfony
rewrite ^(.*)$ /app_dev.php/$1 last;
#fuck thinkphp
rewrite ^(.*)$ /index.php?s=$1 last;
}
location ~ ^/.+?\.php(/|$) {
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
add_header pathinfo $fastcgi_path_info;
fastcgi_param HTTPS off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment