使用Typecho+Nginx+php-fpm加载css报错502
迷茫
迷茫 2017-05-16 12:02:53
[PHP讨论组]

网址如下:https://crazyc.cn/index.php

php-fpm使用默认配置,没有改过

nginx配置有两个
第一个

server {
        listen  80;
        server_name crazyc.cn www.crazyc.cn;
        rewrite ^/(.*)$ https://crazyc.cn permanent;
        error_log /logs/error.log;
        charset     utf-8;
        client_body_buffer_size                         512k;
        proxy_connect_timeout                           90;
        proxy_send_timeout                              90;
        proxy_read_timeout                              4000;
        proxy_buffers                                   32 4k;
        client_max_body_size 75m;
        # Load configuration files for the default server block.
        location / {
            root /var/www/html;
            index index.php index.html;
        }
        location ^~ /path {
                deny all;
        }

    }

第二个

server {
    listen       443 ssl;
    server_name crazyc.cn www.crazyc.cn;
    ssl on;
    ssl_certificate /root/.acme.sh/crazyc.cn/fullchain.cer;
    ssl_certificate_key /root/.acme.sh/crazyc.cn/crazyc.cn.key;
    ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers  HIGH:!ADH:!EXPORT56:RC4+RSA:+MEDIUM;
    error_log /logs/error.log;
    error_page 404 = https://crazyc.cn/404.html;
    charset     utf-8;

    client_max_body_size 75m;
        # Load configuration files for the default server block.
    location ~ \.php$ {
        root html;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
        include fastcgi_params;
    }
    location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {
        root /var/www/html;
        proxy_pass https://127.0.0.1:9000;
    }
}

如图所示,获取不到css,报错502,求大神指教

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

全部回复(1)
滿天的星座

location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {
        root /var/www/html;
        proxy_pass https://127.0.0.1:9000;
    }

改为

location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {
        root /var/www/html;
        proxy_pass https://127.0.0.1;
    }

静态资源不走9000端口

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号