Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

SOLVED: Docker error behind NGINX

Edited

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

0 votes
Answer accepted

@dwfa 

 

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

Cheers

Kurt

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/;
}
}
}

@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?

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

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

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?

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. 

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.

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 ...

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

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 ...

0 votes

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

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

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
Community showcase
Published in Confluence

Welcome to the Confluence Holiday Workshop 🎁

Welcome to Confluence’s Holiday Workshop, where knowledge and collaboration collide! This year come celebrate the holidays with brand-new Confluence features to kick off your new year, best practic...

562 views 11 31
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you