Nginx, это пассивные проверки. 20 марта 2017 г., 18:40 пользователь BieZax <nginx-fo...@forum.nginx.org> написал:
> Добрый день. > Имеется следующий конфиг: > > location = /abc/auth { > internal; > proxy_set_header X-CAuth-Realm "Registration"; > proxy_set_header X-CAuth-Base "access"; > proxy_set_header X-CAuth-Table "users"; > proxy_set_header X-CAuth-GField "_S_abc"; > proxy_set_header X-CAuth-PassF "password"; > client_max_body_size 0; > proxy_pass_request_body off; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header Host $host; > proxy_set_header Content-Length ""; > proxy_set_header X-Original-URI $request_uri; > proxy_pass http://127.0.0.1:8079; # тут висит perl > демон и > авторизует > } > > location /abc/ { > auth_request /abc/auth; > proxy_set_header Host abc-i1.balhblah.ru; > proxy_pass http://abc; > proxy_redirect http://abc-i1.blahblah.ru/ /; > proxy_redirect http://abc-i2.blahblah.ru/ /; > proxy_next_upstream error timeout invalid_header http_500 > http_503 http_502 http_504; > } > > ... > upstream abc { > ip_hash; > server abc-i1.blahblah.ru; > server abc-i2.blahblah.ru; > } > > Все работает нормально, пока один из бэкендов не начинает > отдавать 502 > > Вот пример лога: > > logformat '$remote_addr - $remote_user [$time_local] "$request" ' '$status > $bytes_sent "$http_referer" ' '"$http_user_agent" "$cookie_CID" > "$request_time" "$upstream_response_time" "$upstream_addr" > "$upstream_status" "$upstream_http_server"' > > 2 строчки из лога, идущие подряд: > 10.105.5.152 - vasya [20/Mar/2017:17:03:15 +0300] "GET > /abc/Account/Login?ReturnUrl=%2Fabc%2F HTTP/1.0" 200 3295 "-" "Mozilla/5.0 > (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 > Safari/537.36" "wmmDEljC0bF6XGXtCV9/Ag==" "10.105.5.152" "0.136" "0.003, > 0.113" "10.10.11.72:80, 10.10.11.71:80" "502, 200" "Microsoft-IIS/8.5" > 10.105.5.152 - vasya [20/Mar/2017:17:03:16 +0300] "POST > /abc/ru-RU/Account/Login?ReturnUrl=%2Fabc%2F HTTP/1.0" 502 713 > "https://blahblah.ru/abc/Account/Login?ReturnUrl=%2Fabc%2F" "Mozilla/5.0 > (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 > Safari/537.36" "wmmDEljC0bF6XGXtCV9/Ag==" "0.024" "0.004" "10.10.11.72:80" > "502" "Microsoft-IIS/8.5" > В error логе при этом пусто. > > Разве при такой конфигурации фронтенд не должен всегда спрашивать > второй сервер, если один из них не отвечает? Почему при одной и тоже > конфигурации получается 2 разных реакции? > > Posted at Nginx Forum: https://forum.nginx.org/read. > php?21,273046,273046#msg-273046 > > _______________________________________________ > nginx-ru mailing list > nginx-ru@nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx-ru
_______________________________________________ nginx-ru mailing list nginx-ru@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx-ru