<p>I have a Kubernetes cluster with an (kubernetes) Nginx Ingress controller with the following ingress rules:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-rules
#  namespace: default

### Virtual hosts ###
spec:

  rules:

  - host: dashboard.example.com
    http:
      paths:
        - path: /
          backend:
            serviceName: test
            servicePort: 443
</code></pre>

<p>The <code>test</code> application is served by a Tomcat server.</p>

<p>The <code>server.xml</code> for the Tomcat is:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Server port="8005" shutdown="SHUTDOWN"&gt;
  &lt;Listener className="org.apache.catalina.startup.VersionLoggerListener" /&gt;
  &lt;Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /&gt;
  &lt;Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /&gt;
  &lt;Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /&gt;
  &lt;Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /&gt;

  &lt;GlobalNamingResources&gt;
    &lt;Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" /&gt;
  &lt;/GlobalNamingResources&gt;

  &lt;Service name="Catalina"&gt;

    &lt;Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
        URIEncoding="UTF-8"
               redirectPort="443" /&gt;

    &lt;Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
        sslImplementationName="org.apache.tomcat.util.net.jsse.JSSEImplementation"
        scheme="https" secure="true" URIEncoding="UTF-8"
               maxThreads="150" SSLEnabled="true"&gt;
        &lt;SSLHostConfig&gt;
            &lt;Certificate certificateKeystoreFile="conf/odvsdva.p12"
        certificateKeystorePassword="sdvsdvsdvsd"
                         type="RSA" /&gt;
        &lt;/SSLHostConfig&gt;
    &lt;/Connector&gt;

    &lt;Connector port="8009" protocol="AJP/1.3" redirectPort="443" /&gt;

    &lt;Engine name="Catalina" defaultHost="localhost"&gt;

      &lt;Realm className="org.apache.catalina.realm.LockOutRealm"&gt;
        &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/&gt;
      &lt;/Realm&gt;

      &lt;Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"&gt;

        &lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &amp;quot;%r&amp;quot; %s %b" /&gt;

      &lt;/Host&gt;

    &lt;/Engine&gt;
  &lt;/Service&gt;
&lt;/Server&gt;
</code></pre>

<p>When I open in a browser <code>dashboard.example.com</code> when the path in the <code>Ingress</code> is <code>/</code> , I get the Tomcat standard status page (If you're seeing this, you've successfully installed Tomcat. Congratulations!).</p>

<p>Now, if I go to <code>dasboard.example.com/test</code> I can open my app.</p>

<p>However, I would like to open the app just by navigating to <code>dashboard.example.com/</code>.</p>

<p>So, I try changing the path in the <code>Ingress</code> from <code>/</code> in <code>/test</code>. But then I get <code>This site can’t be reached</code> in the browser.</p>

<p>I did not setup Tomcat and I have very little know-how on it. I hope I provide enough details above.</p>

<p>EDIT</p>

<p>My k8s cluster is inside an Ubuntu vagrant VM.</p>

<pre><code>root@vagrant:/home/vagrant# kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.4", GitCommit:"67d2fcf276fcd9cf743ad4be9a9ef5828adc082f", GitTreeState:"clean", BuildDate:"2019-09-18T14:51:13Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.7", GitCommit:"6c143d35bb11d74970e7bc0b6c45b6bfdffc0bd4", GitTreeState:"clean", BuildDate:"2019-12-11T12:34:17Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

Kostas Demiris
<p>Keep path in the Ingress as <code>/</code></p>

<p>Remove the out-of-the-box <code>ROOT/</code> directory from tomcat and rename your war file to <code>ROOT.war</code> before deploying it.</p>
