Kibana behind Nginx - Discover : Not Found

This is the config :

server
{
listen 443;
server_name elk.localhost;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.users;
location /
{
proxy_pass http://localhost:9200;
rewrite ^/es(.*) /$1 break;
}

location ~ ^/es.*$
{
    proxy_pass http://localhost:9200;
    rewrite ^/es(.*) /$1 break;
}

location /kibana 

{
proxy_pass http://127.0.0.1:5601/app/kibana#/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

location /bundles
{
proxy_pass http://127.0.0.1:5601/bundles;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

location /elasticsearch
{
proxy_pass http://127.0.0.1:5601/elasticsearch;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

location /plugins
{
proxy_pass http://127.0.0.1:5601/plugins;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

location /app/
{
proxy_pass http://127.0.0.1:5601/app/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

location /rabbitmq/api/queues/ {
proxy_pass http://localhost:15672/api/queues/%2F/;
}
location /rabbitmq/api/exchanges/ {
proxy_pass http://localhost:15672/api/exchanges/%2F/;
}
location /rabbitmq/ {
proxy_pass http://localhost:15672/;
}

location ~ ^/kopf/.$ {
proxy_pass http://localhost:9200;
rewrite ^/kopf(.
) /_plugin/kopf/$1 break;
}

location ~ ^/hq.*$
{
    proxy_pass http://localhost:9200;
    rewrite ^/hq(.*) /_plugin/hq/$1 break;
}

error_page 403 /error/403.html;
error_page 404 /error/404.html;
error_page 405 /error/405.html;
error_page 500 501 502 503 504 /error/5xx.html;

location ^~ /error/
{
    internal;
    root /var/www/default;
}

}