i want to redirect all request from the port 80 to 8081 and then in server on 8081 port i want to proxy request main server on port 80 (programatically):))

So, this command work -

sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8081

But, i get circular infinity redirect. Please, help me to figure out how to do this more correctly.

I tried to mark package, but maybe i was doing something wrong, its doesnt work for me :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.