1

I have a web server running at 192.168.1.100 and an Apache 2.2 proxy running at 192.168.1.1

If my web server is listening in on the standard port 80 then I can successfully make an HTTP request

GET http://192.168.1.100/ HTTP/1.1
Host: 192.168.1.100

and get back a response. However, if my web server is running on a non-standard port like 12345 then my request to the proxy

GET http://192.168.1.100:12345/ HTTP/1.1
Host: 192.168.1.100:12345

fails by returning a 404. I can access this page directly when the web server is running on either port 80 or 12345, I can access it through the proxy when the web server is running on port 80, but I can't access it through the proxy when the web server is running on port 12345.

Is there some kind of Apache configuration I need to set to allow requests to go to web servers on nonstandard ports?

EDIT: I should specify that I need a generic forward proxy that can access any site on the internet in addition to these local sites which run on nonstandard ports, so I can't simply set up a reverse proxy without adding configuration for every internal website.

1 Answer 1

1

Reverse Proxy

ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://server.com:12345/
ProxyPassReverse / http://server.com:12345/

-- may work without the / in front but this is how is written into the docs. http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

3
  • Unfortunately, I need to access lots of websites rather than just this one, so I need a forward rather than reverse proxy. Dec 14, 2010 at 19:49
  • not sure I get it - how do you set the forward - from what is written so far you have a proxy - not a reversed proxy and you want the ability to proxy on non standard ports ...
    – silviud
    Dec 15, 2010 at 1:15
  • I have a standard proxy setup via ProxyRequests On and it's important that I be able to get at 192.168.1.100:12345 via a normal proxy request like GET http://192.168.1.100:12345/ HTTP/1.1 which is why using ProxyPass and/or ProxyPassReverse is infeasible. Regardless, thanks for your help so far. Dec 20, 2010 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.