Nginx reverse proxy setup for Kibana

I set the server.basePath: "/kibana" in kibana.yml. But it still doesn't do any redirect.

I updated my Nginx config as below. But Kibana doesn't redirect to home page at all when I clicked on dev tools. Is it because Kibana uses ajax request to refresh the page instead of rendering a page? Is there still a way to configure redirection in Nginx? Thanks! Really appreciate your help!

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       8080;
        server_name  ${HOSTNAME};

        location / {
            # kibana sever
            proxy_pass http://zerus:5601/;
            proxy_set_header Authorization "Basic **";
            proxy_set_header X-Forwarded-User $http_x_forwarded_user;
            # enable real-time interactions
            proxy_buffering off;
            rewrite /login http://localhost:4180/oauth2/sign_in redirect;
        } 
        # if the user is not "admin", then do a redirect when the user tries to access "dev tools"
        if ($http_x_forwarded_user != admin) {
            rewrite ^/api/console.*$ http://zerus:5601/ redirect;
        }
  }
}