nginx 反向代理部分内容反馈404
本帖最后由 师哥 于 2022-9-25 23:10 编辑我用nginx进行了反向代理
server { listen 443 ssl http2; server_name xxx.com; ... location ~/ { proxy_pass http://192.168.1.20:5000; } }比如我访问这个链接,页面反馈404
https://xxx.com/scripts/sencha-touch-2.4.1/resources/css/cupertino.css?v=42661
但是实际url没问题,我在主机直接访问是正常的:
http://192.168.1.20:5000/scripts/sencha-touch-2.4.1/resources/css/cupertino.css?v=42661
但是这情况呢,并不是所有的都是404,比如下面这个,又是正常访问
https://xxx.com/scripts/babel-polyfill/polyfill.js?v=1642756815
不知道是不是我反向代理配置有问题,求军哥指导,我这个是反向代理群晖
贴出完整配置文件来看看 licess 发表于 2022-9-26 08:37
贴出完整配置文件来看看
server
{
listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name xxx.me ;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/xxx.me;
client_max_body_size 5000m;
ssl_certificate /home/wwwssl/xxx.me/xxx.me.crt;
ssl_certificate_key /home/wwwssl/xxx.me/xxx.me.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
ssl_session_cache builtin:1000 shared:SSL:10m;
# openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;
location ~/ {
proxy_pass http://192.168.1.20:5000;
}
}
师哥 发表于 2022-9-26 19:57
server
{
listen 443 ssl http2;
贴出的配置文件没有影响css\js的设置 licess 发表于 2022-9-27 10:51
贴出的配置文件没有影响css\js的设置
感谢军哥帮忙,百度了一下
加上 proxy_http_version 1.1; 就正常了
https://www.orcy.net.cn/1830.html
页:
[1]