This article mainly introduces the Nginx server configuration PathInfo mode (to solve the dolphin PHP background infinite redirection problem), has a certain reference value, now share to everyone, the need for friends can refer to
server {Listen 80; server_name www.yxk.cn yxk.cn; Access_log/data/wwwlogs/www.yxk.cn_nginx.log combined; Index index.html index.htm index.php; Root/data/wwwroot/www.yxk.cn/public; if ($host! = www.yxk.cn) {return 301 $scheme://www.yxk.cn$request_uri; } include/usr/local/nginx/conf/rewrite/thinkphp.conf; #error_page 404/404.html; #error_page 502/502.html; Location ~ [^/]\.php (/|$) {Fastcgi_pass unix:/dev/shm/php-cgi.sock; Fastcgi_index index.php; Fastcgi_split_path_info ^ (. +\.php) (. *) $; Fastcgi_param path_info $fastcgi _path_info; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; #include fastcgi.conf; #include pathinfo.conf; } location ~. *\. (Gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico) $ {expires 30d; Access_log off; } location ~. *\. (JS|CSS)? $ {Expires 7d; Access_log off; } location-/\.ht {deny all; }}thinkphp.conf File Contents: Location/{if (!-e $request _filename) {rewrite ^ (. *) $/Index.php?s=/$1 last; Break }}
Related recommendations:
PHP nginx Server Configuration Support PathInfo