Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have a problem - I have my main site on apache web server on debian on port 80; I develop a web server (in some C++ or C#) and it currently runs on port 6666. But some people are living under firewalls and can access only port 80. I wonder if it is possible via apache map all requests to say mysite.com:80/6666/url as if they were to mysite.com:6666/url, not map via redirection, but really make apache stream content from my site to user as if it were in some folder?

share|improve this question

You could use a reverse proxy via mod_proxy. The Apache Httpd configuration would be along these lines:

    ProxyPass /6666/ http://localhost:6666/
    <Location /6666/>
            ProxyPassReverse /6666/
            Order deny,allow
            Allow from all
share|improve this answer

Here is a good answer on Ask Ubuntu

iptables -t nat -A PREROUTING -p tcp --dport 6666 -j REDIRECT --to-port 80

This assumes you're not routing traffic for an entire network through this box and that if you were there's no expectation that traffic destined for other hosts will be on that port


In case you mess up your iptables, here is a great article on flushing the tables and getting back to normal :)

share|improve this answer
this seems like it would rout users to the entire port 80 - not emulate a folder under it... – myWallJSON Mar 22 '12 at 13:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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