Mobile app version of vmapp.org
Login or Join
Cody1181609

: How to proxy with apache site from same domain but another port as a subfolder? So I have a problem - I have my main site on apache web server on debian on port 80; I develop a web server

@Cody1181609

Posted in: #Apache #Configuration #Proxy

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cody1181609

2 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel560

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

ProxyPass /6666/ localhost:6666/ <Location /6666/>
ProxyPassReverse /6666/
Order deny,allow
Allow from all
</Location>

10% popularity Vote Up Vote Down


 

@Annie201

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


Update

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme