nginx 之cgi fastcgi.conf和fastcgi_params的区别: 只有一行的差别
$: diff fastcgi_params fastcgi.conf【nginx 之cgi fastcgi.conf和fastcgi_params的区别】不再建议大家使用以下方式(搜了一下,网上大量的文章,并且nginx.conf的默认配置也是使用这种方式):
2d1
< fastcgi_param SCRIPT_FILENAME fastcgi_script_name;
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;
}
}
推荐阅读
- Linux|109 个实用 shell 脚本
- linux笔记|linux 常用命令汇总(面向面试)
- Linux|Linux--网络基础
- linux|apt update和apt upgrade命令 - 有什么区别()
- linux|2022年云原生趋势
- Go|Docker后端部署详解(Go+Nginx)
- 开源生态|GPL、MIT、Apache...开发者如何选择开源协议(一文讲清根本区别)
- GitHub|7 款可替代 top 命令的工具