Kibana logout not working when using nginx reverse proxy

Hi,

I know currently there's no anonymous access native in Kibana. I was trying to put nginx container in front to pass credentials to Kibana. So when i access kibana url it directly logs in as a default user. So far so good.

But when i try to logout, to login as a different user, I wasn't prompted a login screen. i hit /logout and again directly get's logged in as default user. I tried to manually access /login uri with kibana url. It prompted me for login, but again i'm logged in as default creds even though i had entered super user creds.

Is there something different about how Kibana handled /logout and /login which i should be aware of while configuring nginx?

As you can see in my nginx conf, i configured it to add default creds only if authorization header is empty.

below is my current nginx conf:

proxy_connect_timeout       600;
proxy_send_timeout          600;
proxy_read_timeout          600;
send_timeout                600;

ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/key.pem;

map $sent_http_authorization $auth {
     default  $sent_http_authorization;
     ""       "Basic ZGVmYXVsdDpkZWZhdWx0";
}

server {
     listen 5601;
     listen 443 ssl;

     server_name <MY_SERVER>:443;

     if ($server_port = 5601) {
         return 301 https://$server_name$request_uri;
     }

     proxy_set_header  Host $host;
     proxy_set_header  X-Real-IP $remote_addr;
     proxy_set_header  X-Forwarded-For $remote_addr;

     location / {
            proxy_set_header  Authorization $auth;
            proxy_pass https://kibana:5601;
     }

}

Similar unanswered question here: https://stackoverflow.com/questions/57510929/how-to-logout-after-using-nginx-as-reverse-proxy#

X-pack Kibana Logout redirection talks about redirection of url. But @Oleg can throw more light on this..

Thanks
Rashmi

Thanks for reply @rashmi

If someone could assist me on this it would be of great help!

@tsullivan pinging you because i used your solution from here: Auto-authenticating to iframe-embedded Kibana dashboard Any suggestions on how to fix this logout issue?