masalah pengimbangan beban nginx berdasarkan nama domain
黄舟
黄舟 2017-05-16 17:08:23
0
1
765

Soalan

upstream ops {
    #ip_hash;
    server 5000.ali-bj.cloud.net:10080 weight=2 max_fails=1 fail_timeout=2;
    server 5000.ali-sh.cloud.net:10080 weight=1 max_fails=1 fail_timeout=2;
    #server 192.168.0.4:5000 max_fails=1 fail_timeout=2;
    #server 127.0.0.1:12309;
    #server 127.0.0.1:12310;
    #server 127.0.0.1:10080 ;
}
----
#web.conf主要配置
    location / {
        add_header Version v3.1.5.3;
        add_header Os QingDao.aliyun.Debian8;
        proxy_set_header         X-Via            QingDao.Aliyun;
        proxy_set_header         Connection       "";
        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_pass http://ops;
        proxy_cache opscache;
        proxy_cache_valid 200 302 5m;
        proxy_cache_valid 301 1h;
        proxy_cache_valid any 1m;

    }

Penerangan:

5000.ali-bj.cloud.net/5000.ali-sh.cloud.net 域名都是解析到同一个ip(192.168.1.124)上的

Lawati nama domain 502:

2017/04/03 11:26:14 [error] 408#408: *1 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.105, server: dev.cloud.net, request: "GET / HTTP/1.1", upstream: "http://192.168.1.124:10080/", host: "dev.cloud.net"

Persoalan?

Bolehkah nginx upstream melakukan pengimbangan beban berdasarkan nama domain? Walaupun selepas menetapkan Hos $http_host, ia masih sama

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

membalas semua(1)
给我你的怀抱

Jelas sekali nginx menyokong hos maya! Kemudian hos maya yang berbeza boleh menentukan huluan yang berbeza!

Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!