openresty重定向您太​​多次

时间:2018-07-06 09:44:23

标签: redirect nginx reverse-proxy nginx-reverse-proxy openresty

我使用openresty反向访问某些网站,但有时会发生错误, 在Chrome浏览器中:redirected you too many times 如何解决?非常感谢 这是我的openresty配置:

upstream web_a {
        server aa.aa.aa.aa.:443;
}
upstream web_b {
        server bb.bb.bb.bb:443;
}
server {
        listen  8443    ssl;
        server_name test.com;
        ssl     on;
        ssl_certificate ../ssl/xxx.pem;
        ssl_certificate_key     ../xxx.key;
        ssl_session_timeout     5m;
        ssl_protocols   TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers     ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_prefer_server_ciphers       on;
        set     $dest   'https://web_a';
        location / {
                default_type 'text/plain';
                client_max_body_size 20m;
                client_body_buffer_size 50k;
                proxy_send_timeout      300s;
                proxy_read_timeout      300s;
                proxy_connect_timeout   300s;
                proxy_buffers   256     4k;
                proxy_max_temp_file_size        0;
                proxy_cache_valid        200    302     10m;
                proxy_cache_valid        301    1h;
                proxy_cache_valid        any    1m;
                if ($http_user_agent ~* "^test/[0-9]\\d*.[0-9]\\d*.[0-9]\\d*") {
                        proxy_pass      $web_b;
                        break;
                }
                proxy_pass      $dest;
        }
}

0 个答案:

没有答案