Hello,
I am trying to configure rabbitmq management interface to be accesed using basic auth from an NGINX vhost, if basic auth is turned off i have no problem accesing the management interface via web.
But configuring nginx to use basic auth, i am asked with User name and password, after providing those, a new dialog box ask again for this information in a loop.
This is nginx vhost:
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 150;
proxy_send_timeout 100;
proxy_read_timeout 100;
proxy_buffers 4 32k;
client_max_body_size 8m;
client_body_buffer_size 128k;
proxy_set_header Authorization "";
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
}
I have tried with and without the proxy_set_header Authorization "";
also place the auth_basic config on the server section.
This is what i see in access_log:
X.X.X.X - admin [05/Jun/2017:16:36:45 -0500] "GET /api/whoami HTTP/1.1" 401 590 "
http://X.Y.Z/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"
201.131.116.249 - admin [05/Jun/2017:16:39:42 -0500] "GET /api/whoami HTTP/1.1" 401 590 "
http://rabbit.mediotiempo.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"
X.X.X.X - - [05/Jun/2017:16:39:44 -0500] "GET /img/rabbitmqlogo.png HTTP/1.1" 401 590 "
http://X.Y.Z/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"
X.X.X.X - admin [05/Jun/2017:16:39:52 -0500] "GET /api/whoami HTTP/1.1" 401 590 "
http://X.Y.Z/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"
This is error_log:
2017/06/05 16:39:52 [error] 17997#0: *35934 user "admin" was not found in "/etc/nginx/htpasswd", client: X.X.X.X, server: X.Y.Z, request: "GET /api/whoami HTTP/1.1", host: "X.Y.Z", referrer: "
http://X.Y.Z/"
I am using basic auth with a user different than admin.
rabbitmq version 3.5.7
Has anyone configured rabbitmq with nginx basic auth??
Thank you.