How can I forward requests coming in on port 80 to another port on the same linux machine?
I used to do this by changing nat.conf
, but this machine that I'm using doesn't have NAT. What's the alternative?
How can I forward requests coming in on port 80 to another port on the same linux machine?
I used to do this by changing nat.conf
, but this machine that I'm using doesn't have NAT. What's the alternative?
You can accomplish the redirection with iptables:
Just found myself in this question and couldn't find an easy way. Don't want to install Nginx in my machine to do this simple port forwarding.
Rinetd
didn't work for me, no working package for my distro. I went forsocat
instead. Super simple:Must be ran as
root
to be able to listen on port80
.You should look at using a reverse proxy, such as Nginx. For example, you might put something like this in your
nginx.conf
file: