duanguangwang5829 2019-04-22 03:01 采纳率: 0%
浏览 142
已采纳

找不到php文件的文件

I have wordpress running behind nginx reverse proxy.

Home etc works fine but when user goes to url with .php ending, I'm getting 404 File not found. error.

Here is related nginx configuration:

        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;
        }
  • 写回答

1条回答 默认 最新

  • douhuireng4407 2019-04-23 04:28
    关注

    Looks like there was another rule which were overriding all php files and returning 404. If you are using bitnami nginx, edit following file;

    sudo vim /opt/bitnami/nginx/conf/bitnami/bitnami.conf

    and comment out

    #include "/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf";

    which is

    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;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作