Config of nginx in front of Kibana with SSL

Note that also some header should be passed:

server {
   listen 80;
   listen [::]:80;      
   server_name kibana.domain.tld;
   return 301 https://$host$request_uri;
}

upstream kibana {
    server 127.0.0.1:5601;
    keepalive 15;
}

# SSL configuration
server {
   listen 443 ssl http2;
   listen [::]:443 ssl http2;   
   server_name kibana.domain.tld;
   ssl on;
   ssl_certificate      /etc/letsencrypt/live/kibana.domain.tld/fullchain.pem;
   ssl_certificate_key  /etc/letsencrypt/live/kibana.domain.tld/privkey.pem;
   ssl_protocols TLSv1.2;
   ssl_prefer_server_ciphers on;
   ssl_session_timeout 1d;
   ssl_session_cache shared:SSL:50m;
#  auth_basic "Restricted Access";
#  auth_basic_user_file /etc/nginx/htpasswd.users;
                
# Required for LE certificate enrollment using certbot
   location '/.well-known/acme-challenge' {
        default_type "text/plain";
        root /var/www/html;
   }
    
   location / {
        proxy_pass http://kibana;
        proxy_http_version 1.1;
        proxy_redirect off;
        proxy_buffering off;

        proxy_set_header Connection "Keep-Alive";
        proxy_set_header Proxy-Connection "Keep-Alive";
        proxy_set_header Host "kibana.domain.tld";
    }
}