NGINX reverse proxy problem


I'm having some difficulties with setting up a reverse proxy in combination with iframes. When using / as the location browsing to, the proxy is working but the root location is skipped and I get the normal Kibana dashboard without any of my own html.

When I change location to something like /app/kibana my own html shows but the iframe isn't loaded.

Is there any way to get this to work?

ServerA: Running NGINX and Kibana
ServerB: Running Elasticsearch, only allows access from ServerA IP


server {
        listen 80;
        listen [::]:80;

        root /var/www/;
        index index.html index.htm index.nginx-debian.html;


        location / {
                proxy_set_header Host $host;
                proxy_pass http://localhost:5601/;

HTML snippet

            <div id="container">
                  <iframe name="frame" iframe id="frame" src="http://localhost:5601/app/kibana#/dashboards"></iframe>

Hey @Sjaak01,

You might have better luck after configuring a base path for Kibana via server.basePath, described here:

Once the base path is set, you can set your location to the configured base path, and have nginx proxy the request from there. Note your iframe src would also change to include this base path.

1 Like


I tried that before but turns out I didn't remove the localhost part from my iframe src so that caused Kibana to not load.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.