nginx 之cgi fastcgi.conf和fastcgi_params的区别

nginx 之cgi fastcgi.conf和fastcgi_params的区别: 只有一行的差别

$: diff fastcgi_params fastcgi.conf
2d1
< fastcgi_param SCRIPT_FILENAME fastcgi_script_name;
【nginx 之cgi fastcgi.conf和fastcgi_params的区别】不再建议大家使用以下方式(搜了一下,网上大量的文章,并且nginx.conf的默认配置也是使用这种方式):
location ~ \.php$ { root/var/www/wordpress; fastcgi_pass127.0.0.1:9000; fastcgi_indexindex.php; #fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name; #includefastcgi_params; includefastcgi.conf; #只用包含fastcgi.conf就行了,上面就可以省去了 }

server { listen80; server_namelocalhost; location / { root/var/www/html; indexindex.html index.htm index.php; } error_page500 502 503 504/50x.html; location = /50x.html { root/var/www/html; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ \.cgi$ { fastcgi_pass 127.0.0.1:8080; fastcgi_index index.cgi; fastcgi_param SCRIPT_FILENAME fcgi$fastcgi_script_name; include fastcgi_params; } }

    推荐阅读