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

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


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


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


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

  • 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 via a normal proxy request like GET 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .