2016-06-04 5 views
-1

У меня есть сервер Nginx, которые проходят запрос от одного URL на некоторые другие сервера Силимаром это:nginx предотвращает запрос сервера форм с ответом на превышение времени ожидания?

upstream main { 
    server {{OPENSHIFT_INTERNAL_IP}}:15010 weight=1 fail_timeout=1s; 
    server {{OPENSHIFT_INTERNAL_IP}}:15011 weight=1 fail_timeout=1s; 
    server {{OPENSHIFT_INTERNAL_IP}}:15012 weight=1 fail_timeout=1s; 
    server {{OPENSHIFT_INTERNAL_IP}}:15013 weight=1 fail_timeout=1s; 

    keepalive 300; 

    } 

location ~* ^/(.*) { 
     proxy_pass http://main; 
     #proxy_read_timeout 5s; 
     proxy_connect_timeout 5s; 
     } 

, так что мне нужно отказывать для отправки запроса занялся серверами, так как я мог предотвратить для запроса перегруженных серверов ,

+0

вы читали http://nginx.org/en/docs/http/ngx_http_upstream_module.html? – Roman

+0

спасибо, я прочитал эту страницу сайта, и я нашел два таких: fail_timeout = время и max_conns = число и match_check match = welcome; который полезен для меня и нуждается в тестировании. –

ответ

0

Я Прогнозируемая модуль в Nginx:

git clone https://github.com/gnosek/nginx-upstream-fair.git 

cd nginx-${NGINX_VERSION} 
./configure\ 
    --prefix=${OPENSHIFT_HOMEDIR}/app-root/runtime/srv/nginx\ 
    --with-pcre=$OPENSHIFT_TMP_DIR/pcre-${PCRE_VERSION}\ 
    --with-zlib=$OPENSHIFT_TMP_DIR/zlib-${ZLIB_VERSION}\ 
    --with-http_ssl_module\ 
    --with-http_geoip_module\ 
    --with-http_realip_module \ 
    --with-http_addition_module \ 
    --with-http_sub_module\ 
    --with-http_dav_module \ 
    --with-http_flv_module \ 
    --with-http_mp4_module \ 
    --with-http_gunzip_module\ 
    --with-http_gzip_static_module \ 
    --with-http_random_index_module \ 
    --with-http_secure_link_module\ 
    --with-http_stub_status_module \ 
    --with-mail \ 
    --with-mail_ssl_module \ 
    --with-file-aio\ 
    --with-ipv6 \ 
    --add-module=$OPENSHIFT_TMP_DIR/nginx-upstream-fair\ 

этой конфигурации:

upstream main { 
    fair; 
    server {{OPENSHIFT_INTERNAL_IP}}:15010 weight=1 fail_timeout=1s; #diy-tornado4ss.rhcloud.com 
    #server {{OPENSHIFT_INTERNAL_IP}}:15011 weight=1 fail_timeout=1s; #diy2-elasa2.rhcloud.com 
    server {{OPENSHIFT_INTERNAL_IP}}:15012 weight=1 fail_timeout=1s; #diy-phantomjs4so.rhcloud.com 
    #server {{OPENSHIFT_INTERNAL_IP}}:15013 weight=1 fail_timeout=1s; 
    #max_connections 3; 
    keepalive 2100; 

    }