Confluence interface not rendering properly - HTTP 404 or 500 errors when loading CSS/JS

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

 

Summary

Confluence interface doesn't render properly. All menus, buttons, and images seem to be broken, without any CSS styling or JavaScript.

There isn't any customization in place and you are accessing Confluence through a reverse-proxy.

When inspecting the Network tab, using Browser Developer Tools, we can see a lot of HTTP 404 (Not Found) errors when loading CSS and JS.


Environment

  • Confluence Server (any version)
  • Reverse-proxy

Diagnosis

Browser cache

As a first step, check if this is not a browser cache issue by trying to:

  1. Access Confluence through a different browser that you never used before
  2. If that is not possible, try an incognito window
  3. Or, try to clear all browser caches and cookies

If the issue persists after those tests, proceed with the next diagnostic steps below.

Tomcat configuration

Review the server.xml file, under <confluence_install>/conf directory, we can't see any proxy information, even though we know for a fact that Confluence is running behind a reverse-proxy:

server.xml
<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"/>

Cause

The server.xml wasn't configured to run behind a reverse-proxy.

Some parameters are missing - for example, proxyName, proxyPort, or a Context path.

Solution

  1. Stop Confluence
  2. Edit the file <confluence_install>/conf/server.xml
  3. Add the parameters proxyPort and proxyName to the existing connector. Example, when using a Reverse-proxy with SSL offoading:

    server.xml
    <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="<proxy_host>.<domain>.com" proxyPort="443"/>
  4. If the reverse-proxy is set with a context path (e.g. /confluence), ensure to set it accordingly:

    server.xml
    <Context path="/confluence" 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>
  5. Save the server.xml file
  6. Start Confluence

Additional documentation related to Confluence and proxies:


Last modified on May 18, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.