Jenkins 2 & Apache 503 Service Unavailable

Just a quick post in case anybody else has started having problems with their Jenkins recently. Perhaps it’s an obvious problem but it took me a minute!

AJP reverse proxy

If you’re anything like me, you may have set up Jenkins CI to use an AJP reverse proxy, because at the time you were on an old CentOS where the supported Apache didn’t yet work with the recommended HTTP reverse proxy option.

If you then upgraded to CentOS 7 or another new distro, and to Apache 2.4, you’ll probably have forgotten you even did this and it will have likely continued working.

For a while…

Until this month, that is,when Jenkins 2 became the LTS release and the version you get from an innocuous yum update (or similar).

At this point you might realise that dropping AJP reverse proxy support is one of the very few breaking changes in Jenkins 2.x. Apache can’t see your favourite butler any more and returns 503 Service Unavailable.

HTTP to the rescue

Fortunately if you’re already on Apache 2.4, once you establish the problem it’s very easy to fix. The current guide to Running Jenkins behind Apache shows you the right configuration for an HTTP reverse proxy.

For me it was just a couple of lines change from my AJP setup in the virtual host configuration. A quick service restart later, I’m happily running Jenkins 2 with no further config changes.

Leave a Reply

Your email address will not be published. Required fields are marked *