找不到php文件的文件
我让wordpress在nginx反向代理后运行 Home etc工作正常,但当用户转到以.php结尾的url时,我发现404找不到php文件的文件,php,wordpress,nginx,reverse-proxy,nginx-location,Php,Wordpress,Nginx,Reverse Proxy,Nginx Location,我让wordpress在nginx反向代理后运行 Home etc工作正常,但当用户转到以.php结尾的url时,我发现404文件未找到。错误 以下是相关的nginx配置: location /en/us/ { proxy_pass https://10.0.10.11/en/us/; proxy_set_header X-Real-IP $remote_addr; proxy_set
文件未找到。
错误
以下是相关的nginx配置:
location /en/us/ {
proxy_pass https://10.0.10.11/en/us/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
}
看起来有另一条规则覆盖了所有php文件并返回404。如果您使用的是bitnami nginx,请编辑以下文件
sudo vim/opt/bitnami/nginx/conf/bitnami/bitnami.conf
然后评论出来
#包括“/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf”代码>
那是
location ~ "\.php$" {
fastcgi_index index.php;
if (!-f $realpath_root$fastcgi_script_name) {
return 404;
}
include /etc/nginx/conf/phpfastcgiparam.conf;
fastcgi_pass unix:/run/php7/php-fpm.sock;
}
“相关”是什么意思?此配置文件中是否有其他位置
块?对于此路径,没有。wordpress home在/en/us下运行良好/