I have apache2 running on the port 80 and other application server running on 81.
I would like to redirect traffic only for one specific, selected domain (mydomain.com) to server running on the port 81 and access this website like http://mydomain.com/
I added iptables rule:
iptables -A PREROUTING -t nat -i eth0 -p tcp -d mydomain.com -j REDIRECT --to-port 81
but unfortunately not only this selected domain have been redirected, but also all other websites running on port 80 and apache2 that shouldn't be redirected to port 81.
Is there any solution to achieve only one selected domain redirection to another port?
Any help would be highly appreciated.