nginx proxy_pass解析器无法正常工作

时间:2015-11-02 05:59:57

标签: nginx reverse-proxy resolver

我已经设置了一个nginx(1.9.5)作为少数tomcat服务器的代理。我使用proxy_pass指令通过route53域名指向这些服务器。不知何故,"解析器"解析域名的指令在启动期间工作一次。但它并没有重新解决,尽管" resolver"指令设置。

   server {

        listen 443;
        server_name localhost;
        ssl on;
        resolver 10.0.0.2 valid=10s;

        ssl_certificate /etc/nginx/certs/ssl-bundle3.crt;
        ssl_certificate_key /etc/nginx/certs/chewie.key;
        ssl_dhparam /etc/nginx/certs/dhparam.pem;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_session_cache    shared:SSL:20m;
        ssl_session_timeout 180m;
        ssl_prefer_server_ciphers on;
        ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";

        location / {
                resolver_timeout 30s;
                resolver 127.0.0.1 valid=10s;
                set $target "http://abctest.hello.world:80";
                proxy_pass $target;
                proxy_cache_bypass true;
                    proxy_no_cache true;
                    proxy_set_header        X-Real-IP       $remote_addr;
                    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

                    proxy_ssl_session_reuse on;

                    error_log  /var/log/nginx/error.log debug;

            }
    }

0 个答案:

没有答案