cptactionhank / docker-atlassian-jira

Atlassian JIRA Core wrapped in a Docker image
https://cptactionhank.github.io/docker-atlassian-jira
MIT License
621 stars 248 forks source link

Pre-routing or connection error behind reverse proxy #81

Closed amo42 closed 5 years ago

amo42 commented 6 years ago

Dear Martin,

first, many thanks for providing these awesome docker images for Atlassian.

I'm currently evaluation this kind of setup but noticed an issue while link the applications.

I'm using your images for Jira and Confluence. But while creating the application link, Jira is not able to reach the Confluence application. Both containers are on the same docker host. In front of the application container runs a traefik reverse proxy for handling the domain and https stuff.

For both container a sub domain was created jira.mytld.com and wiki.mytld.com

Both containers were started with the correct proxy settings.

X_PROXY_SCHEME | https
X_PROXY_PORT | 443
X_PROXY_NAME | <<appName>>.mytld.com

After some tests I've noticed the following behavior.

A simple curl from inside the Confluence container works just fine. The domain is resolved to the Public Docker host IP. But a curl from inside the Jira Container to conf.mytld.com is resolved to the internal container IP. In general this should work as both container are in the same docker network and using the same gateway.

here the curl -v output (same for https, but with port 443 instead of 80)

bash-4.4$ curl -v wiki.mytld.com
* Rebuilt URL to: wiki.mytld.com/
*   Trying 172.19.0.4...
* TCP_NODELAY set
* connect to 172.19.0.4 port 80 failed: Host is unreachable
* Failed to connect to wiki.mytld.com port 80: Host is unreachable
* Closing connection 0
curl: (7) Failed to connect to wiki.mytld.com port 80: Host is unreachable

And as mentioned, every application works just find from the internet. But the Jira container is not able to "talk" to the Confluence container. While Confluence can do it

I do not fully understand why one container is using the public host IP while the other one uses the internal docker IP.

Do you have any suggestions how I can fix this or identify the root cause? I'm pretty sure I've just misses something very simple :/

Thanks in advance and Best regards Andreas

amo42 commented 6 years ago

Hi @cptactionhank

In the meanwhile I've noticed that the issue belongs to the port. As the local docker IP is used, I assume the port set up did not allow access to the application. Port 80 and 443 is only reachable using the reverse proxy.

Do you know how I can set up Jira and Confluence using either ONLY the TLD or ONLY the internal docker IP with the ports used internal?

Thanks in advance Andreas

amo42 commented 5 years ago

obsolete. With new setup everything is working. Was a network issue within the docker containers.