Confluence itself does not support multiple domains out of the box, however this is desired for certain Scroll Viewport use cases.
If your Confluence installation sits behind a reverse proxy and you want to run a viewport on a domain that is different from the Confluence base URL, you may have to make some changes to your networking setup to ensure that everything works correctly.
Common effects of an incomplete configuration are:
Viewports with a custom domain name are not reachable
Confluence rejecting certain requests whose server name does not match the name of the host.
For example: POST requests to /rest/webResources/1.0/resources that fail with a status code of 403
We recommend to use the proxy debugger tool within Viewport to debug your settings to identify possible issues during the setup.
Required Configuration Changes
There are several ways to configure Confluence / Tomcat and a reverse proxy to support multiple domains in Scroll Viewport, each with certain drawbacks and benefits.
If you just want to configure one additional domain, choose approach 1. If you need many additional domains, choose approach 2.
Approach 1: Additional Tomcat Connector
For this approach we'll configure a separate Tomcat listener for the additional domain.
Properties of this approach:
Simple to set up
Compatible with Confluence setup checks
Requires additional memory for the threads serving requests for the new connector (1MB per thread configured in maxThreads attribute)
Configuration overhead when many additional domains are required
Tomcat Configuration
Tomcat Configuration
In server.xml find the enabled connector. It should look like this:
Approach 2: Shared Tomcat Connector for multiple Domains
For this approach we'll configure a single Tomcat connector so it supports multiple domains.
The actual domain used by requests will be extracted from a HTTP header which needs to be set by the reverse proxy.
Properties of this approach:
Does not require additional memory for multiple tomcat connectors
No Confluence configuration updates and restart required when adding further domains later on
Not compatible with Confluence setup checks. Confluence system administrators will get warnings from Confluence. Disable the "Confluence Base Url Plugin" to suppress.
More complicated to set up initially
Atlassian support might not be aware of this setup
Tomcat Configuration
Tomcat Configuration
In server.xml find the enabled connector. It should look like this: