I'm using Apache to redirect a subdomain to a port (mod_proxy
, mod_proxy_http
, mod_proxy_ajp
) and IP Tables to restrict direct port access except to me and the local server.
My IP Tables looks like so:
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP tcp -- !c-24-7-110-109.hsd1.ca.comcast.net anywhere tcp dpt:tproxy
ACCEPT tcp -- localhost anywhere tcp dpt:tproxy
DROP tcp -- !c-24-7-110-109.hsd1.ca.comcast.net anywhere tcp dpt:http-alt
DROP tcp -- !c-24-7-110-109.hsd1.ca.comcast.net anywhere tcp dpt:webmin
ACCEPT tcp -- localhost anywhere tcp dpt:webmin
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
The context I'm going to use in this post is:
Sonatype Nexus: nexus.example.com => example.com:8081
Jenkins CI: jenkins.example.com => example.com:8080
Webmin: webmin.example.com => example.com:10000
What I have working right now is no direct port access except to me. I also want the local system to be able to access ports which is what, I believe, I have now. I'm using mod_proxy_ajp
for Jenkins CI and Webmin and mod_proxy_http
for Sonatype Nexus.
When I visit direct ports, each of these services loads just fine. When I have asked someone else to load each, they can't, so that's working.
Now, however, when trying to access one of the subdomains, get I get a never ending load (infinite loop?)
When I run a tracert on the subdomain, though, it ends fine so I can cross out infinite loop.
Here is my Sonatype Nexus apache virtual host configuration:
<VirtualHost *:80>
ServerName nexus.majornoob.com
ServerAlias www.nexus.majornoob.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8081/
ProxyPassReverse / http://localhost:8081/
ProxyPassReverseCookiePath / /
ErrorLog /var/www/majornoob/error-nexus.log
LogLevel warn
CustomLog /var/www/majornoob/access-nexus.log combined
</VirtualHost>
and here is my Jenkins:
<VirtualHost *:80>
ServerName jenkins.majornoob.com
ServerAlias www.jenkins.majornoob.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / ajp://127.0.0.1:8080/
ProxyPassReverse / ajp://127.0.0.1:8080/
ProxyPassReverseCookiePath / /
ErrorLog /var/www/majornoob/error-jenkins.log
LogLevel warn
CustomLog /var/www/majornoob/access-jenkins.log combined
</VirtualHost>
These two examples of virtual hosts are using mod_proxy_ajp
and mod_proxy_http
respectively.
Can anyone help me to figure out why I am getting an infinite load?
Thanks.
edit: Nevermind on the infinite loop. After some time, I received a 503 Service Unavailable error.