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?
7,159
Try this to access the app on port 9999 using http://www.example.com/
<VirtualHost *:80>
ServerAdmin [email protected]
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 videos on Youtube
Author by
inman320
Updated on September 18, 2022Comments
-
inman320 over 1 year
httpd.conf vhost looks like this:
<VirtualHost *:9999> ServerAdmin [email protected] 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 [email protected] 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.
-
inman320 about 12 yearshi, not sure what that's supposed to do since it seems like it wouldn't be serving the localhost app at all with those settings, but in any case, with the single change you made to ProxyPass, httpd won't even restart.
-
user9517 about 12 yearsSee my edit. To be honest it's not entirely obvious what youre trying to achieve.
-
inman320 about 12 yearssorry my original post was too long - the main thing is that the site already loads correctly using the lan ip 192.168.1.5:9999 from a web browser on the server itself, but it doesn't load from other computers on the same network.
-
Magellan about 12 yearsYou check IPTables?