V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
SirYuxuan
V2EX  ›  问与答

一个非常诡异的反向代理问题

  •  
  •   SirYuxuan · 12 天前 · 645 次点击
    我有一个目标地址 http://127.0.0.1/(公网 IP 家里的 NAS 系统,非 80 端口)
    问题是今天之前都访问的好好的!今天突然不行了。
    我创建了一个反向代理配置了 2 个域名
    a.domain1.com

    a.domain2.com

    这时候第一个域名可以正常访问,第二个访问不了(erorr 502)是为啥呢
    5 条回复    2024-09-12 11:01:57 +08:00
    hanierming
        1
    hanierming  
       12 天前
    啥配置也不贴,让人干想呢?
    SirYuxuan
        2
    SirYuxuan  
    OP
       12 天前
    server {
    listen 80;
    server_name a.domain1.com a.domain2.com;
    location ^~ / {


    proxy_pass http://127.0.0.1/;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-Port $remote_port;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;

    proxy_connect_timeout 60s;
    proxy_send_timeout 600s;
    proxy_read_timeout 600s;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    }
    }
    大概这样
    hanierming
        3
    hanierming  
       12 天前
    看一下 nginx 的日志有没有记录
    看一下服务本身是否支持第二个域名访问?
    SirYuxuan
        4
    SirYuxuan  
    OP
       12 天前
    配置第二个域名仅仅是为了演示,a 域名可以,b 域名不可以,单独配 a,c,d 域名都可以,就 b 不行,
    *9 recv() failed (104: Connection reset by peer) while reading response header from upstream,
    ho121
        5
    ho121  
       12 天前
    @SirYuxuan 被墙了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5691 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 06:21 · PVG 14:21 · LAX 23:21 · JFK 02:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.