Добрый день всем!

Можно ли заставить работать одновременно conn_limit и auth_request
одновременно?

Желаемая схема такая:   
location /data0002 {
        auth_request /authcheck;
        auth_request_set $error_code $upstream_http_x_error_code;
        auth_request_set $token $upstream_http_x_token;
        limit_conn connections 1;
        limit_conn_status 429;        
        error_page 403 =200 /forbiden;
        error_page 429 =200 /to_many_connections;
        proxy_intercept_errors on;
        proxy_pass_request_body off;
        proxy_set_header Content-Length "";
        proxy_pass http://127.0.0.1:8000/data;
        error_page 500 501 502 503 504 404 403 =200 /no_data;
}

Но смысл в том, что похоже conn_limit отрабатывает до auth_check и $token
устанавливается после того, как отработает conn_limit.
Причем, задать $token статически, то conn_limit отрабатывает, но это не
интересно.....

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?21,265797,265797#msg-265797

_______________________________________________
nginx-ru mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Ответить