Welcome! Log In Create A New Profile

Advanced

Re: Пустая переменная $upstream status при 499

Maxim Dounin
December 27, 2019 12:04PM
Hello!

On Fri, Dec 27, 2019 at 10:03:51AM -0500, yanda.a wrote:

> Maxim Dounin Wrote:
> -------------------------------------------------------
> > Hello!
> >
> > При "proxy_ignore_client_abort on;" статуса 499 быть вообще не
> > должно.
> >
> > Что показывает "nginx -V" и что в конфиге?
> >
> > --
> > Maxim Dounin
> > http://mdounin.ru/
> > _______________________________________________
> > nginx-ru mailing list
> > nginx-ru@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-ru
>
> nginx version: nginx/1.16.1
> built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
> built with OpenSSL 1.1.1d 10 Sep 2019
> TLS SNI support enabled
> configure arguments: --sbin-path=/usr/sbin/nginx
> --modules-path=/usr/lib64/nginx/modules --prefix=/etc/nginx
> --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log
> --http-log-path=/var/log/nginx/log/nginx/access.log
> --http-client-body-temp-path=/var/tmp/nginx/client_body
> --http-proxy-temp-path=/var/tmp/nginx/proxy
> --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi
> --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi
> --http-scgi-temp-path=/var/tmp/nginx/scgi --pid-path=/run/nginx.pid
> --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-compat
> --with-file-aio --with-ipv6 --with-http_addition_module
> --with-http_auth_request_module --with-http_dav_module
> --with-http_degradation_module --with-http_flv_module
> --with-http_geoip_module=dynamic --with-http_gunzip_module
> --with-http_gzip_static_module --with-http_image_filter_module=dynamic
> --with-http_mp4_module --with-http_perl_module=dynamic
> --with-http_random_index_module --with-http_realip_module
> --with-http_secure_link_module --with-http_slice_module
> --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module
> --with-http_v2_module --with-http_xslt_module=dynamic --with-mail=dynamic
> --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic
> --with-stream_realip_module --with-stream_ssl_module
> --with-stream_ssl_preread_module
> --with-openssl=../third_party/openssl-1.1.1d
> --with-openssl-opt=enable-tls1_3 --with-threads
> --add-dynamic-module=modules/ngx_brotli
> --add-dynamic-module=modules/xss-nginx-module-0.06
> --add-dynamic-module=modules/naxsi-0.56
> --add-dynamic-module=modules/incubator-pagespeed-ngx-1.13.35.2-stable
> --add-dynamic-module=modules/lua-nginx-module-0.10.15
> --add-dynamic-module=modules/ngx_devel_kit-0.3.1 --with-cc-opt='-O2 -g -pipe
> -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
> --param=ssp-buffer-size=4 -grecord-gcc-switches
> -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fPIC'
> --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie -Wl,-rpath,/usr/lib64
> -ljemalloc'
>
> Что именно нужно из конфига? Просто он очень большой, не думаю что это
> хорошая идея

В идеале - из конфига нужен полный минимальный конфиг, на котором
видно описанное поведение. Вот, скажем, на таком - не видно:

daemon off;
master_process on;
error_log stderr info;

worker_processes 1;

events {
worker_connections 1024;
}


http {
log_format test "status: $status\n"
"upstream_addr: $upstream_addr\n"
"upstream_status: $upstream_status";

access_log /dev/stderr test;

upstream u {
server 127.0.0.1:8081;
server 127.0.0.1:8082;
}

server {
listen 8080;

location / {
proxy_pass http://u;
proxy_ignore_client_abort on;
proxy_read_timeout 3s;
}
}

server {
listen 8081;
listen 8082;
delay 5s;
access_log off;
}
}

(Директива delay - от ngx_http_delay_module,
http://mdounin.ru/hg/ngx_http_delay_module/, вместо неё можно
использовать любой бекенд, который отвечает долго.)

Делаем запрос и сбрасываем соединение:

$ curl -k "http://127.0.0.1:8080/foo"
^C

На выходе получаем:

status: 504
upstream_addr: 127.0.0.1:8081, 127.0.0.1:8082
upstream_status: 504, 504

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Re: Пустая переменная $upstream status при 499

Maxim Dounin December 27, 2019 09:14AM

Re: Пустая переменная $upstream status при 499

yanda.a December 27, 2019 10:03AM

Re: Пустая переменная $upstream status при 499

yanda.a December 27, 2019 10:10AM

Re: Пустая переменная $upstream status при 499

Maxim Dounin December 27, 2019 12:04PM

Re: Пустая переменная $upstream status при 499

yanda.a December 30, 2019 03:21AM

Re: Пустая переменная $upstream status при 499

Maxim Dounin December 31, 2019 06:00AM

Re: Пустая переменная $upstream status при 499

yanda.a January 13, 2020 04:46AM

Re: Пустая переменная $upstream status при 499

Maxim Dounin January 13, 2020 07:34AM

Re: Пустая переменная $upstream status при 499

yanda.a January 13, 2020 08:12AM

Re: Пустая переменная $upstream status при 499

yanda.a January 13, 2020 08:14AM

Re: Пустая переменная $upstream status при 499

Maxim Dounin January 13, 2020 02:40PM

Re: Пустая переменная $upstream status при 499

yanda.a January 13, 2020 03:07PM

Re: Пустая переменная $upstream status при 499

Maxim Dounin January 14, 2020 07:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 172
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready