Kibana index patterns couldn't find any Elasticsearch data when server.basePath is set

I have installed ElasticSearch and Kibana (v 7.9.3) on a windows server.

ElasticSearch is available on port 9200.

I use reverse proxy on IIS for access to Kibana from outside. So I specified the server.basePath in configuration file (server.basePah: "/kibana" and server.host: "0.0.0.0"). So I can get Kibana from outside with "myServerUrl/kibana"

But when I want to create a new index pattern, kibana couldn't find any Elasticsearch data. Even if I have many index with docs. I can see all index in Index Management tab or by query "_cat/indices?v"

When I try to create new index pattern on localhost:5601 (by remove server.path) Kibana can find all index pattern available.

Why Kibana doesn't find any ElasticSearch data when I use server.basePath but can find data on localhost ?

Can you show your IIS reverse proxy configuration? It's easy to make a mistake in there and some requests won't get passed through correctly

Here is the web.config file :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://127.0.0.1:5601/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Please check out this blog article - It seems like it's related to your case and there's some additional config necessary: https://www.smbadmin.com/2017/07/securing-kibana-with-iis-reverse-proxy.html

I set up the part on "Configure the IIS Reverse Proxy".

Kibana still couldn't find any Elasticsearch data. I tried with the basePath set (port 80 with url like "severname/kibana" that redirect to 5601) and without basePath set (with a new website on IIS host on 5600 that redirect to 5601).

In both cases the redirection still seems to blocked when I want to add an index from Kibana.

The new web.config file :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:5601/{R:1}" />
                    <serverVariables>
                        <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
                        <set name="HTTP_ACCEPT_ENCODING" value="" />
                    </serverVariables>
                </rule>
            </rules>
            <outboundRules>
                <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                    <match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:5601/(.*)" />
                    <action type="Rewrite" value="http{R:1}://servername.fr/kibana/{R:2}" />
                </rule>
                <rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding">
                    <match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" />
                    <action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                    <preCondition name="NeedsRestoringAcceptEncoding">
                        <add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />
                    </preCondition>
                </preConditions>
            </outboundRules>
        </rewrite>
    </system.webServer>
</configuration>

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