Skip to content

Instantly share code, notes, and snippets.

@oak-tree
Created June 23, 2016 09:53
Show Gist options
  • Select an option

  • Save oak-tree/953f2ed75554be3689c41ab4c7a20f93 to your computer and use it in GitHub Desktop.

Select an option

Save oak-tree/953f2ed75554be3689c41ab4c7a20f93 to your computer and use it in GitHub Desktop.
nginx + php configration
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment