Prompt the "Tomcat config is incorrect"
Asked by tequila:

Hi all,

I have configured Nginx with SSL and follow up below link. Unfortunately, login through by DNS and already prompt the "Tomcat config is incorrect" message.

<https://easycloudsupport.zendesk.com/hc/en-us/articles/360001941411-Running-Confluence-behind-NGINX-with-SSL>

Tomcat config is incorrect  
The Tomcat server.xml has an incorrect configuration:

scheme should be 'https'  
proxyName should be 'confluence.xxxxxx.com'  
proxyPort should be '443'

The follow the resolution refer the link, restarted Nginx \& Confluence services but still occurred.

<https://confluence.atlassian.com/confkb/can-t-check-base-url-warning-in-confluence-6-6-or-later-939718433.html>

OS Version CentOS Linux release 8.2.2004 (Core)

Confluence Version 7.5.1

Thanks.


Answers:
author: Nic Brough -Adaptavist-
body: Could you show us your server.xml and tell us what the base url of your system is? Please do obscure the actual server name as you have above in the proxy name, but give us the rest.

comments: author: tequila
body: Thanks Nic.

Note that the URL just serve for internal DNS only.

Here is my configuration file of server.xml :-  
\<Server port="8000" shutdown="SHUTDOWN" debug="0"\>  
\<Service name="Tomcat-Standalone"\>  
\<!--  
==============================================================================================================  
DEFAULT - Direct connector with no proxy, for unproxied HTTP access to Confluence.

If using a http/https proxy, comment out this connector.  
==============================================================================================================  
--\>  
\<Connector port="8090" connectionTimeout="20000" redirectPort="8443"  
maxThreads="48" minSpareThreads="10"  
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"  
protocol="org.apache.coyote.http11.Http11NioProtocol"/\>  
\<!--  
==============================================================================================================  
HTTP - Proxying Confluence via Apache or Nginx over HTTP

If you're proxying traffic to Confluence over HTTP, uncomment the connector below and comment out the others.  
Make sure you provide the right information for proxyName and proxyPort.

For more information see:  
Apache - <https://confluence.atlassian.com/x/4xQLM>  
nginx - <https://confluence.atlassian.com/x/TgSvEg>

==============================================================================================================  
--\>

\<Connector port="8090" connectionTimeout="20000" redirectPort="8443"  
maxThreads="48" minSpareThreads="10"  
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"  
protocol="org.apache.coyote.http11.Http11NioProtocol"  
scheme="http" proxyName="sub.domain.com" proxyPort="80"/\>

\<!--  
==============================================================================================================  
HTTPS - Direct connector with no proxy, for unproxied HTTPS access to Confluence.

For more info see <https://confluence.atlassian.com/x/s3UC>  
==============================================================================================================  
--\>

\<!--  
\<Connector port="8443" maxHttpHeaderSize="8192"  
maxThreads="150" minSpareThreads="25"  
protocol="org.apache.coyote.http11.Http11Nio2Protocol"  
enableLookups="false" disableUploadTimeout="true"  
acceptCount="100" scheme="https" secure="true"  
clientAuth="false" sslProtocol="TLSv1.2" sslEnabledProtocols="TLSv1.2" SSLEnabled="true"  
URIEncoding="UTF-8" keystorePass="\<MY_CERTIFICATE_PASSWORD\>"/\>  
--\>

\<!--  
==============================================================================================================  
HTTPS - Proxying Confluence via Apache or Nginx over HTTPS

If you're proxying traffic to Confluence over HTTPS, uncomment the connector below and comment out the others.  
Make sure you provide the right information for proxyName and proxyPort.

For more information see:  
Apache - <https://confluence.atlassian.com/x/PTT3MQ>  
nginx - <https://confluence.atlassian.com/x/cNIvMw>  
==============================================================================================================  
--\>

\<Connector port="8090" connectionTimeout="20000" redirectPort="8443"  
maxThreads="48" minSpareThreads="10"  
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"  
protocol="org.apache.coyote.http11.Http11NioProtocol"  
scheme="https" secure="true" proxyName="confluence.xxxxx.com" proxyPort="443"/\>

\<Engine name="Standalone" defaultHost="localhost" debug="0"\>  
\<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4"\>  
\<Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true"\>  
\<!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties --\>  
\<Manager pathname=""/\>  
\<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/\>  
\</Context\>

\<Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy" debug="0"  
reloadable="false" useHttpOnly="true"\>  
\<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/\>  
\</Context\>  
\</Host\>  
\</Engine\>  
\</Service\>  
\</Server\>  


author: tequila
body: .


author: tequila
body: FQDN for internal only. Thanks.


author: Nic Brough -Adaptavist-
body: That server.xml is defining three connectors on the same port. It looks like Tomcat accepts that, but only runs the first one, which is not correctly configured for your proxy.

You need to comment out the first and second connector in your file (starting at lines 10 and 28 respectively), and let it use the correct one which starts on line 65


author: tequila
body: Hi Nic, I have disabled below 2 sections, restarted the service and the "Tomcat config is incorrect" message disappeared.

DEFAULT - Direct connector with no proxy, for unproxied HTTP access to Confluence.

HTTP - Proxying Confluence via Apache or Nginx over HTTP

Many thanks for your assistance.


Tags: confluence-server

server