Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SOLVED: Docker error behind NGINX

dwfa April 18, 2020

I have configured confluence docker image to run behind NGINX using postgreSQL and I get this error

Tomcat config is incorrect

The Tomcat server.xml has an incorrect configuration:

scheme should be 'http'
proxyName should be 'wiki.dwfa.ca'
proxyPort should be '80'

Troubleshoot

 

I have set the environment variables in the script that starts docker according to the documentation for confluence docker image.

ATL_PROXY_NAME=wiki.dwfa.ca
ATL_PROXY_PORT=80
ATL_TOMCAT_PORT=8090

Why is this occurring?

2 answers

1 accepted

1 vote
Answer accepted
Kurt Klinner
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2020

@dwfa 

 

Could you share your complete tomcat config as well as the nginx config?

Cheers

Kurt

dwfa April 18, 2020

I did not alter the tomcat server.xml since it is inside the docker image.  As for NGINX:

worker_processes 1;

events { worker_connections 1024; }

http
{
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

server
{
listen 80;
server_name localhost;

location /
{
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root /usr/share/nginx/html;
}
}

server
{
listen 80;
server_name wiki.dwfa.ca;
location /
{
proxy_pass http://localhost:8090/;
}
}
}
Kurt Klinner
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2020

@dwfa

the nginx config looks good,

based on the docker documentation the shared variables should also be fine.

Are you using docker-compose to start the container or how does your docker call look like?

dwfa April 18, 2020
docker run -v /usr/local/data/confluence/v7.3:/var/atlassian/application-data/confluence --name=confluence -d -p 8090:8090 -p 8091:8091 atlassian/confluence-server
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 18, 2020

Have you configured your docker image to make the needed changes to server.xml?

dwfa April 18, 2020

I am going to say no since the Atlassian documentation did not mention that.  I am going to a assume I will have to do the following

  • copy that server.xml from the container to host
  • update the server.xml file
  • copy the server.xml file back to the container from the host
  • assume using docker cp command

OR

  • generate a new docker image

Either way a learning experience for me :-) Do I have that right?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 19, 2020

Not sure why you need to do all of that when all that's needed is to edit the server.xml, but yes, if you want to do it that way, it will work. 

dwfa April 19, 2020

I looked for an editor when I issued

docker exec -it <containerID> /bin/sh 

but could not find vim, vi, nor nano - and I do not think emacs is loaded into the image :-).  Other suggestions would be appreciated.

dwfa April 19, 2020

So I updated server.xml file (/opt/atlassian/confluence/conf) inside the container with the appropriate settings and restarted the container.   I got the same error message, so I looked at the server.xml file and my changes were gone.  It seems the files was revereted or it was regenerated (looked at the DTS of the file and it was the time the container started up) ...

Ugh ...

dwfa April 19, 2020

I got it working - thx for the support.  I needed to change the /opt/atlassian/etc/server.xml.j2 file

it look like this

proxyName="{{ atl_proxy_name | default(catalina_connector_proxyname) | default('') }}"
proxyPort="{{ atl_proxy_port | default(catalina_connector_proxyport) | default('') }}"

and I changed it to look like this

proxyName="{{ atl_proxy_name | default(catalina_connector_proxyname) | default('wiki.dwfa.ca') }}"
proxyPort="{{ atl_proxy_port | default(catalina_connector_proxyport) | default('80') }}"

That kinda tells there there is a bug in how the boot up process works.  Guess I have to go over and report a defect :-).  Unless I am not understanding something ...

 

dwfa

dwfa April 20, 2020

I am going to close this as answered - there is enough info in this to help someone else I hope :-).

On the other hand, I have no way of opening a defect to indicate the docker image does not utilize the environment variables.

Thanks for all your help ...

Zeljko Milovanovic January 16, 2024

This also applies to our case, even though we used Traefik as a Proxy. 

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 18, 2020

You'll need to amend the server.xml file to include the scheme, proxyName and proxyPort in the connector settings.

dwfa April 18, 2020

So that means I have to build my docker image based upon the one from hub.docker.com?  Do I understand that correctly?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 18, 2020

I don't know, I've not looked at that image.

All I know is that if you want to run it behind a proxy, those three things need to be added into the connector settings in server.xml

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.3.5
TAGS
AUG Leaders

Atlassian Community Events