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

能帮忙看一下这段 upstream 代码哪边有问题吗?

  •  
  •   jsjcjsjc · 2019-01-05 22:25:54 +08:00 · 953 次点击
    这是一个创建于 2150 天前的主题,其中的信息可能已经有所发展或是发生改变。

    做了几个 ddns 服务准备放一起使用,我记得上次使用的时候还没有问题啊~~这次就不行了,感谢

    upstream test {
        ip_hash;
    
        server 127.0.0.1:8001;
        server 127.0.0.1:8002;
        server 127.0.0.1:8003;
    }
    
    server {
        listen        80;
        server_name xxxxxxx.320.io
        index index.html;
    
        location /{
            proxy_pass         http://test;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $http_host;
            proxy_set_header   X-Real-IP   $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_cache_bypass $http_upgrade;
        }
    }
    
    
    
    server {
        listen        8001;
        index index.html;
    
        location /{
            proxy_pass         http://jsjcjsjc.xxxxx.io/;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $http_host;
            proxy_set_header   X-Real-IP   $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_cache_bypass $http_upgrade;
        }
    }
    
    server {
        listen        8002;
        index index.html;
    
        location /{
            proxy_pass         http://jsjcjsjc.xxxxxx.cn/;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $http_host;
            proxy_set_header   X-Real-IP   $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_cache_bypass $http_upgrade;
        }
    }
    
    server {
        listen        8003;
        index index.html;
    
        location /{
            proxy_pass         http://nas.xxxxxx.net/;
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $http_host;
            proxy_set_header   X-Real-IP   $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_cache_bypass $http_upgrade;
        }
    }
    
    1 条回复    2019-01-06 12:00:45 +08:00
    jsjcjsjc
        1
    jsjcjsjc  
    OP
       2019-01-06 12:00:45 +08:00
    自己顶一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   881 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 21:59 · PVG 05:59 · LAX 13:59 · JFK 16:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.