Welcome! Log In Create A New Profile

Advanced

auth_request is being ignored

Posted by devRocks 
auth_request is being ignored
April 22, 2021 11:35PM
My config is below. My auth server is not even being accessed. the auth_request directive is being completely ignored.

Any help is deeply appreciated!


server {
listen 80 default_server;
listen [::]:80 default_server ;


root /var/www/html;

index index.html index.htm index.nginx-debian.html;
server_name <server_name>; # managed by Certbot


location / {


auth_request /auth;

error_page 401 = @error401;

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100M;
client_body_buffer_size 1m;
proxy_http_version 1.1;
proxy_redirect off;

proxy_intercept_errors on;
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 256 16k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_max_temp_file_size 0;
proxy_read_timeout 300;
# end of optimizations

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:3000;
}


location = /auth {
internal;
proxy_pass https://<myauth server>/auth/;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header Host $host;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Authorization $http_authorization;
proxy_pass_header Authorization;

}
location @error401 {
add_header Set-Cookie "NSREDIRECT=$scheme://$http_host$request_uri;Domain=.<my domain>;Path=/";
return 302 https://<main application>/login;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 80
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready