Welcome! Log In Create A New Profile

Advanced

auth_request и conn_limit

April 01, 2016 03:02AM
Добрый день всем!

Можно ли заставить работать одновременно 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 отрабатывает, но это не интересно.....
Subject Author Posted

auth_request и conn_limit

Vans_ April 01, 2016 03:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 150
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