dougutuo9879 2014-12-01 01:41
浏览 51

FastCGI上的PHP(通过Plesk)为所有不以.php结尾的内容提供404

I just switched my PHP to run from Apache to FastCGI (via Plesk). Now every file I try to access on my domain that's not a php file (like css, images, html ...) gives a 404.

Any idea of what it could be?

vhost specific config file (/etc/nginx/plesk.conf.d/vhosts/mysite.com.conf):

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

server {
    listen 99.99.99.99:443 ssl;

    server_name mysite.com;
    server_name www.mysite.com;
    server_name ipv4.mysite.com;

    ssl_certificate             /usr/local/psa/var/certificates/certEbk3rnT;
    ssl_certificate_key         /usr/local/psa/var/certificates/certEbk3rnT;
    ssl_session_timeout         5m;

    ssl_protocols               SSLv2 SSLv3 TLSv1;
    ssl_ciphers                 HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;

    client_max_body_size 128m;

    root "/var/www/vhosts/mysite.com/httpdocs";
    access_log "/var/www/vhosts/system/mysite.com/logs/proxy_access_ssl_log";
    error_log "/var/www/vhosts/system/mysite.com/logs/proxy_error_log";

    location / {
        proxy_pass https://99.99.99.99:7081;
        proxy_set_header Host             $host;
        proxy_set_header X-Real-IP        $remote_addr;
        proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header X-Accel-Internal /internal-nginx-static-location;
        access_log off;
    }

    location /internal-nginx-static-location/ {
        alias /var/www/vhosts/mysite.com/httpdocs/;
        add_header X-Powered-By PleskLin;
        internal;
    }

}

server {
    listen 50.23.99.2:80;

    server_name mysite.com;
    server_name www.mysite.com;
    server_name ipv4.mysite.com;

    client_max_body_size 128m;

    root "/var/www/vhosts/mysite.com/httpdocs";
    access_log "/var/www/vhosts/system/mysite.com/logs/proxy_access_log";
    error_log "/var/www/vhosts/system/mysite.com/logs/proxy_error_log";

    location / {
        proxy_pass http://99.99.99.99:7080;
        proxy_set_header Host             $host;
        proxy_set_header X-Real-IP        $remote_addr;
        proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header X-Accel-Internal /internal-nginx-static-location;
        access_log off;
    }

    location /internal-nginx-static-location/ {
        alias /var/www/vhosts/mysite.com/httpdocs/;
        add_header X-Powered-By PleskLin;
        internal;
    }

}
  • 写回答

1条回答 默认 最新

  • dtiu94034 2014-12-02 16:00
    关注

    Requests of *.php files working because nginx transparent proxing it to apache, which catched by proper apache's vhost.

    Statics files get 404 because:

    1. proper nginx's vhost can't be found by nginx and request cathced by default vhost
      or
    2. there some another nginx vhost which catch all requests(wildcard subdomain *.mysite.com for example).

    No any useful advices here, just revise all your nginx configs.

    评论

报告相同问题?

悬赏问题

  • ¥15 全志v3s怎么设置高速时钟,使用的荔枝派zero开发板,串口2需要921600的波特率
  • ¥15 关于#单片机#的问题:Lora通讯模块hc-14电路图求内部原理图
  • ¥50 esp32 wroom 32e 芯片解锁
  • ¥15 bywave配置文件写入失败
  • ¥20 基于Simulink的ZPW2000轨道电路仿真
  • ¥15 pycharm找不到在环境装好的opencv-python
  • ¥15 在不同的执行界面调用同一个页面
  • ¥20 基于51单片机的数字频率计
  • ¥50 M3T长焦相机如何标定以及正射影像拼接问题
  • ¥15 keepalived的虚拟VIP地址 ping -s 发包测试,只能通过1472字节以下的数据包(相关搜索:静态路由)