: 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
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?
More posts by @Cody1181609
2 Comments
Sorted by latest first Latest Oldest Best
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>
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 :)
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.