Apache Reverse Proxy 503 Service Unavailable



How to Detect cause of 503 Service Temporarily Unavailable error, There is of course some apache log files. Search in your apache configuration files for 'Log' keyword, you'll certainly find plenty of them. Depending on your OS​ Having a 503 error in Apache usually means the proxied page/service is not available. Although your proxy log message seems to be indicating that Apache might have been trying to connect using IPV6 and your allowable address (127.0.0.1) is an IPv4 address. If that's the case, I'd try and ensure that the Apache-to-Tomcat tunnel on port 8009 used IPv4, since I don't thing IPv6 gains you a lot on a loopback connection.

  1. Apache 503 Error
  2. Apache Reverse Proxy 503 Service Unavailable Code
  3. Apache Reverse Proxy 503 Service Unavailable
  4. Apache Reverse Proxy 503 Service Unavailable List

In this article, we are going to configure Apache as a reverse proxy to wildfly through mod_proxy module.
Outline of the setup is shown below.
This setup assumes that we have Apache and 2 standalone instances of Wildfly running.

Apache side config changes

Apache Reverse Proxy 503 Service Unavailable

1. Mod_Proxy module comes in-built with other Apache modules. Add/uncomment the below lines in $APACHE_HOME/conf/httpd.conf

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

2. Add below lines to the end of $APACHE_HOME/conf/httpd.conf
Proxypass /server1/ http://localhost:8080/
ProxypassReverse /server1/ http://localhost:8080/

Apache reverse proxy 503 service unavailable code

Proxypass /server2/ http://localhost:8280/
ProxypassReverse /server2/ http://localhost:8280/

3. Restart Apache service.
E:Apache Web serverApache24bin>net stop apache2.4
The Apache2.4 service is stopping.
The Apache2.4 service was stopped successfully.

E:Apache Web serverApache24bin>net start apache2.4
The Apache2.4 service is starting.
The Apache2.4 service was started successfully.

Apache 503 Error

Service

Wildfly side config changes

Apache Reverse Proxy 503 Service Unavailable Code

No change needed to Wildfly configuration. By default, undertow subsystem provides http connector.
<subsystem xmlns=”urn:jboss:domain:undertow:1.2″>
<buffer-cache name=”default”/>
<server name=”default-server”>
<http-listener name=”default” socket-binding=”http”/>
<host name=”default-host” alias=”localhost”>

Apache reverse proxy 503 service unavailable due

Apache Reverse Proxy 503 Service Unavailable

TESTING

Apache Reverse Proxy 503 Service Unavailable List

Now browse http://localhost/server1 and http://localhost/server2. The default wildfly page gets displayed. Try to shutdown first wildfly instance and you will see 503 Service Unavailable error on the browser for http://localhost/server1.