I'm in the process of migrating some applications to a new production server.
The idea is to keep the same URLs for the applications by defining ProxyPass
and ProxyPassReverse
directives on the old production server.
Configurationon old production server:
<VirtualHost *:80>
ServerName some-url.prod.smething.com
ServerAlias some-url.smething.com
ProxyPreserveHost On
ProxyPass / http://10.XX.XX.XX:10022/
ProxyPassReverse / http://10.XX.XX.XX:10022/
</VirtualHost>
On the new production server:
<VirtualHost *:80>
ServerName some-url.prod.smething.com
ServerAlias some-url.smething.com
ServerAlias some-url.newprod.smething.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:10022/
ProxyPassReverse / http://127.0.0.1:10022/
</VirtualHost>
I have tested this successfully between the two development servers but it does not work between the production ones. i get the following error:
503 Service Unavailable
and in the logs:
(111)Connection refused: proxy: HTTP: attempt to connect to (10.xx.xx.xx) failed
ap_proxy_connect_backend disabling worker for (10.xx.xx.xx)
I think my apache configuration on production is correct because it is the same as on dev.
Looking around for solutions, it was mentioned several times that it might not work if machines were in a different subnet range. I think this is my case, but unfortunately there was a solution provided for that.
Old production server IP: 172.XX.XX.XX
New production server IP: 10.XX.XX.XX
Any ideas how I can fix this issue ?