Occasional 502 bad gateway from Apache HTTP proxy

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

The content on this page relates to platforms which are not supported. Consequently, Atlassian Support cannot guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.

Problem

Users will occasionally receive an error page reporting a "Bad gateway" condition. This means the proxy couldn't get a response from the application server.

Cause

This can result from a known issue in Apache, which affected versions 2.0.63 through 2.2.3 and was marked as resolved with 2.2.4. Apache wasn't checking for one of the possible conditions for its connections to the application server, so it would periodically (e.g., once in tens of thousands of requests) use a connection handle that had been reset by the application server.

Resolution

Upgrade to the latest version of Apache httpd.

If you're using a web server compiled from source and have a strong reason not to upgrade, you also have the option of making a tiny edit to the source as described in one of the comments and recompiling.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.