Proxypass apache over nonstandard port – how can it be that the 192.168.*:9999 works from the computer itself but not another computer on the network

apache-2.2localhostportproxypass

httpd.conf vhost looks like this:

<VirtualHost *:9999>
    ServerAdmin admin@example.com
    ServerName  www.example.com
    ServerAlias example.com

    # Indexes + Directory Root.
    DirectoryIndex index.php
    DocumentRoot /var/www/html/example.com/wordpress

    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyPass / http://localhost:8888/
    ProxyPassReverse / http://www.example.com:9999/
    #ProxyPassReverseCookieDomain localhost:8888 www.example.com:9999/
    ProxyPassReverseCookiePath / /

</VirtualHost>
<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName  www.example.com
    ServerAlias example.com

    # Indexes + Directory Root.

    DirectoryIndex index.php
    DocumentRoot /var/www/html/example.com/wordpress
</VirtualHost>

the computer (192.168.1.5) running apache itself is trying to serve wordpress from the standard example.com and proxy a localhost app on port 9999 (example.com:9999) to the internet. the wordpress site works from 192.168.1.5 from anywhere on the network, but the localhost app proxy on 192.168.1.5:9999 works on 192.168.1.5 itself but not on other computers within the network. i think if 192.168.1.5:9999 worked over the network, it would also work on the internet as a whole (port forwarding is alreadyconfigured over the router), but I can't see why it would only work on the originating server and not its peers.

Best Answer

Try this to access the app on port 9999 using http://www.example.com/

<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName  www.example.com
    ServerAlias example.com

    ProxyRequests Off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    ProxyPass / http://localhost:9999/
    ProxyPassReverse / http://localhost:9999/
    ProxyPassReverseCookiePath / /
</VirtualHost>
Related Topic