V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
frea
V2EX  ›  NGINX

Nginx 反向代理动态站点 不同路径不同端口 显示空白页

  •  
  •   frea · 2018-11-14 19:56:29 +08:00 · 2942 次点击
    这是一个创建于 2202 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如题,被代理的后端服务器是 Jetty
    访问时,浏览器中显示空白页,页面标题可正常显示,查看源代码也是有内容的。
    这和因为被代理的是动态站或者 https 有关系吗?
    关键配置如下:


    upstream site{
    server localhost:80;
    }
    upstream site2{
    server localhost:8080;
    }
    upstream site3{
    server localhost:8090;
    }

    server {
    listen 8100 ssl http2;
    listen [::]:8100 ssl http2;
    server_name example.com;
    access_log logs/access.log;
    ssl_certificate ./conf/ssl/example.com/example.com.crt;
    ssl_certificate_key ./conf/ssl/example.com/example.com.key;

    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 5m;

    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;
    location /site {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Remote_addr $remote_addr;
    proxy_pass http://site/;

    }
    location /site2 {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Remote_addr $remote_addr;
    proxy_pass http://site2/;

    }
    location /site3 {
    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Remote_addr $remote_addr;
    proxy_pass http://site3/;

    }
    }
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1215 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:44 · PVG 01:44 · LAX 09:44 · JFK 12:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.