If you have used php In nginx, you must know that nginx has never supported php pathinfo well. In the past, we used some handy methods to achieve this effect. In the end, we often need to work with php. set cgi in ini. fix_pathinfo1. In addition, this document has been messy. Basically, every document you find has its own
If you have used php In nginx, you must know that nginx has never supported php pathinfo well. In the past, we used some handy methods to achieve this effect. In the end, we often need to work with php. set cgi in ini. fix_pathinfo = 1. In addition, this document has been messy. Basically, every document you find has its own
If you have used php In nginx, you must know that nginx has never supported php pathinfo well. In the past, we used some handy methods to achieve this effect.php.ini
Settingscgi.fix_pathinfo = 1
. In addition, this document has been messy. Basically, each document you find has its own practice.
After upgrading nginx recently, I found that the official support for php-fpm has been greatly improved. Maybe this is a long time, however, forgive me for not having read the configuration file carefully in the 0.8 version.
Specifically, it addsfastcgi_split_path_info
In this way, the configuration becomes very simple. Delete the previousserver
For phplocation
Configure and add the following content
location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; }
Note that the above Code passes the test in nginx 1.1.19.
Well, that's what it looks like. You don't need to customize a bunchfastcgi_param
. Note: If you have enabledcgi.fix_pathinfo = 1
Disable it.
Original address: Nginx configuration PHP-FPM support Pathinfo, thanks to the original author to share.