Setup Confluence on server with jwilder/nginx-reverseproxy gives 403 when setting CATALINA_CONNECTOR
Asked by Florian B?r:

Hi all

I've a setup with docker. To handle the requests, i have a reverse proxy called jwilder/nginx-proxy called with the following parameters:

# docker run -d -p 80:80 -p 443:443 -v /etc/nginx/ssl:/etc/nginx/certs -v /var/run/docker.sock:/tmp/docker.sock:ro --name nginx-proxy jwilder/nginx-proxy

This uses certbot to have ssl support.

As data storage i use a postgres sql with the following parameters:

docker run --name confluencedb -e POSTGRES_PASSWORD=PasswordHere -e POSTGRES_USER=ADMIN -e POSTGRES_DB=Confluence -d postgres

And then, i set up confluence with the following parameters:

run -v /mnt/data/confluence-data:/var/atlassian/application-data/confluence --name="baerwiki" -d -e VIRTUAL_HOST=confluence.DOMAIN.com -e CATALINA_CONNECTOR_PROXYNAME=confluence.DOMAIN.com -e CATALINA_CONNECTOR_SECURE="true" -e CATALINA_CONNECTOR_PROXYPORT="443" --link confluencedb atlassian/confluence-server

If i set up confluence without the proxy settings, i am able to setup confluence but have problems with creating a new space (which is according to the documentation because tomcat has to know the reverse proxy information). But if i set it up like this with CATALINA_\* stuff, i'm not even able to connect to the instance.

Thanks


Answers:
author: Florian B?r
body: Hi

Sorry, i have tried to find this server.xml file in my docker container but was not able to find it. Can you tell me, which directory i have to mount in the docker container to access this file?

comments: author: AnnWorley
body: Server.xml is the conf subdirectory of the Confluence Install directory. Please see this article to find the directory on your instance: [Confluence Home and other important directories](https://confluence.atlassian.com/doc/confluence-home-and-other-important-directories-590259707.html)


author: Florian B?r
body: I'm not able to access this directory in my docker container.


author: AnnWorley
body: One of my colleagues suggested that you could open a terminal session with this command, then you could navigate to the directory:

```
docker exec -it <containerIdOrName> bash
```

You will need to configure Docker to make the server.xml edits persist when the container is restarted.


author: AnnWorley
body: Hi - How does it work if you use Tomcat's **\<confluence_install\>conf/server.xml** to add proxy support as described in [Proxy Support](https://tomcat.apache.org/tomcat-8.5-doc/config/http.html#Proxy_Support)?

For example, the connector directive looks something like

```
 <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
 maxThreads="200" minSpareThreads="10"
 enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" />
```

and the proxyName and proxyPort would be added so it would be similar to:

```
<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
 maxThreads="200" minSpareThreads="10"
 enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" proxyName="<subdomain>.<domain>.com"
 proxyPort="443"
 scheme="https"/>
```

I look forward to hearing how that works in your environment.


Tags: docker

reverse-proxy