<p>If it's a brand new Jenkins, you can try creating an SSH tunnel directly into the container with port 8080 and checking if the problem also appears there. That will at least allow you to check if it's Jenkins redirecting you or Nginx.</p>

<p>There you can also try adjusting "Jenkins URL" in "Manage Jenkins" -> "Configure System". </p>

<p>Alternatively, check  <code>jenkins_home/jenkins.model.JenkinsLocationConfiguration.xml</code>. jenkinsUrl tag is also present there.</p>

CC BY-SA 4.0
2020-05-31T21:15:18.990Z
2020-05-31T21:15:18.990Z
clorz
<p>The Jenkins container redirects to <code>URL:80</code>, which is causing an error. When I remove the <code>:80</code>, everything is working as it should.</p>

<p>I have tried the proxy with a simple web app and there were no issues.</p>

<p>This is the <code>docker-compose.yml</code> <a href="https://pastebin.com/djJTuBZL" rel="nofollow noreferrer">https://pastebin.com/djJTuBZL</a>.</p>

<p>The cert is correctly issued and the connection is secured. The host I'm using is live and correctly configured with ports 80 and 443 open.</p>

<p>The container exposes <code>8080</code> and this is the same as the <code>VIRTUAL_PORT</code>.</p>

<p>Also, I would have assumed that accessing an address with <code>:80</code> wouldn't have caused any issues this being the standard HTTP port eg <code>www.google.com:80</code>; unless I'm missing something.</p>

<p>If this helps this is the logs when I run <code>docker-compose up</code> <a href="https://pastebin.com/NUbDL7PC" rel="nofollow noreferrer">https://pastebin.com/NUbDL7PC</a>.
Here are the logs when I try to do the first login, the space is before I remove the <code>:80</code> then load the page <a href="https://pastebin.com/0wxGDBzi" rel="nofollow noreferrer">https://pastebin.com/0wxGDBzi</a>.</p>

<p>How can I resolve this problem?</p>

<docker><jenkins><docker-compose>
Jenkins Docker Behind Reverse Proxy Adds ":80" to the URL
Kyle.C
# Jenkins Docker Behind Reverse Proxy Adds ":80" to the URL

(Asked by: username_0 on 2020-05-30)

The Jenkins container redirects to `URL:80`, which is causing an error. When I remove the `:80`, everything is working as it should.

I have tried the proxy with a simple web app and there were no issues.

This is the `docker-compose.yml` <https://pastebin.com/djJTuBZL>.

The cert is correctly issued and the connection is secured. The host I'm using is live and correctly configured with ports 80 and 443 open.

The container exposes `8080` and this is the same as the `VIRTUAL_PORT`.

Also, I would have assumed that accessing an address with `:80` wouldn't have caused any issues this being the standard HTTP port eg `www.google.com:80`; unless I'm missing something.

If this helps this is the logs when I run `docker-compose up` <https://pastebin.com/NUbDL7PC>.
Here are the logs when I try to do the first login, the space is before I remove the `:80` then load the page <https://pastebin.com/0wxGDBzi>.

How can I resolve this problem?

**Tags:** docker, jenkins, docker-compose


---

## 1 answers

### Answer by username_1 on 2020-05-31. Score: 1

If it's a brand new Jenkins, you can try creating an SSH tunnel directly into the container with port 8080 and checking if the problem also appears there. That will at least allow you to check if it's Jenkins redirecting you or Nginx.

There you can also try adjusting "Jenkins URL" in "Manage Jenkins" -> "Configure System".

Alternatively, check `jenkins_home/jenkins.model.JenkinsLocationConfiguration.xml`. jenkinsUrl tag is also present there.


---

