<p>I feel like this is a basic question but I'm struggling to find anything concrete in my research. This must be a common problem and im not sure what to google.</p>

<p>I'm running an air gapped Kubernetes cluster with a bunch of service on whom all have UIs. My services are exposed using NodePort. I can navigate to the ui by doing ip addr:NodePort. I have DNS setup using dnsmasq so I can access the URL at example.domain.com:NodePort.</p>

<p>I want to "hide" the nodeport portion of the url so that users/clients can access apps at example.domain.com/appname. </p>

<p>Im running an Apache Webserver to serve some files and I have implemented a bunch of redirects e.g.</p>

<p>Redirect permanent /appname <a href="http://example.domain.com:30000/" rel="nofollow noreferrer">http://example.domain.com:30000/</a></p>

<p>which works semi-nicely when access the UIs via firefox browser e.g. example.domain.com/appname. This does change the URL in the users address bar but I can live with that. The problem with this is that some clients don't automatically redirect to <a href="http://example.domain.com:30000/" rel="nofollow noreferrer">http://example.domain.com:30000/</a> and instead just present the 301 status code.</p>

<p>Can somebody point me in the right direction please.</p>

<p>Thanks</p>

Murchy
<p>After seeing Ijaz answer I was able to refine my google search a little and came up with the below:</p>

<p>/etc/hosts</p>

<pre><code>192.168.100.1 example.domain.com gitlab.domain.com example
</code></pre>

<pre><code>&lt;VirtualHost *:80&gt;
  ServerName gitlab.domain.com
  ProxyPass / http://example.domain.com:30100/
  ProxyReversePass / http://example.domain.com:30100/
&lt;/VirtualHost&gt;

systemctl restart httpd dnsmasq
</code></pre>

<p>If you navigate to gitlab.domain.com you will be redirected to the correct port (30100).</p>

<p>The downside to this is that one has to have a domain name for every application that I deploy. I would have preferred to do something similar to:</p>

<p>/etc/hosts</p>

<pre><code>192.168.100.1 example.domain.com example
</code></pre>

<pre><code>&lt;VirtualHost *:80&gt;
  ServerName example.domain.com
  ProxyPass /gitlab http://example.domain.com:30100/
  ProxyReversePass /gitlab http://example.domain.com:30100/

  ProxyPass /jira http://example.domain.com:30111/
  ProxyReversePass /jira http://example.domain.com:30111/
&lt;/VirtualHost&gt;
</code></pre>

<p>However when I navigated to example.domain.com/gitlab it would append the correct url e.g. the landing page for gitlab is /users/sign_in, example.domain.com/users/sign_in however my browser displayed Not Found. The request URL /users/sign_in was not found on the server. </p>

<p>I couldnt figure out the correct configuration. If anyone has any further thoughts to fix this please let me know.</p>
