您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

nginx如何配置子目录的fastcgi_pass?

2025/11/15 1:50:26发布22次查看
location /wordpress { alias /usr/local/nginx-1.6.2/html/wordpress; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename /usr/local/nginx-1.6.2/html/wordpress$fastcgi_script_name; include fastcgi_params; }

发现script_filename会包含,/wordpress,怎么才能去掉这个子目录?只传递后面的部分?
回复内容: location /wordpress { alias /usr/local/nginx-1.6.2/html/wordpress; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename /usr/local/nginx-1.6.2/html/wordpress$fastcgi_script_name; include fastcgi_params; }

发现script_filename会包含,/wordpress,怎么才能去掉这个子目录?只传递后面的部分?
ss --unix --all | grep php
输出类似:
u_str listen 0 128 /run/php-fpm/php-fpm.sock 30653 * 0
我在 nginx.conf 中的配置
fastcgi_pass unix:/run/php-fpm/php-fpm.sock
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product