<p>I have a container/pod that exposes 2 ports, 3000, and 3010 as separate nodeport services. The exposed APIs on port 3010 work fine as those do not require an authorization header, however the services on port 3000 DO require a bearer authorization
token header and it seems somehow it's getting stripped or something?</p>
<p>Any request I send I get back a 401 unauthorized. I'm testing locally with minikube in Mac OS X. I am using the <code>minikube service &lt;servicename&gt; --url</code> command to get the URL for the nodeport service and then proceeding to run <code>curl</code> on the provided URL to test connectivity.</p>
<pre><code>curl --location --request GET http://&lt;url&gt;:&lt;port&gt;/info/ping --header 'Authorization: Bearer blah'
</code></pre>
<p>returns:</p>
<pre><code>{&quot;error&quot;:&quot;Unauthorized&quot;}
</code></pre>
<p>This is despite the fact that <code>blah</code> is the bearer auth token.</p>
<p>Is this known issue? What possibly else could be going on? I have replicated this with a different container that also uses bearer auth.</p>
<p>Thank You</p>

Josh Klein
<p>In theory nothing should be stripped.</p>
<p>NodePorts are layer 4 ports TCP/UDP and http is layer 7.  I would take a look at your Bearer token if it has a newline or some other character at the end.</p>
<p>I would also debug in the pod itself:</p>
<pre><code>$ kubectl exec -it &lt;pod-name&gt; bash
# curl localhost:&lt;local-service-pod&gt; ...
</code></pre>
