Added alias ip, creating eth0:0. network restarted,
ngix is listened on alias ip:
server {
listen alias.ip:80;
From server machine I can access www using
# lynx http://alias.ip/
How to forward port/redirect(?) ?
Added alias ip, creating eth0:0. network restarted,
ngix is listened on alias ip:
server {
listen alias.ip:80;
From server machine I can access www using
# lynx http://alias.ip/
How to forward port/redirect(?) ?
No port forwarding is required. Make sure your DNS names point at alias.ip, and it should work. If alias.ip is an internal IP address and you need this to be available on the public internet, then the same rules apply as for any other IP address. Example (to be put into iptables on gateway that does the forwarding):
iptables -t nat -A PREROUTING -p tcp -d 123.234.0.1 --dport 8080 -j DNAT --to-destination <alias.ip>:80
This will forward incoming requests to port 8080 on IP address 123.234.0.1 to port 80 on your alias IP. Obviously for this to work, the public DNS must point to 123.234.0.1, and the users must know that they have to use port 8080 in their browser requests.
You may also need other iptables rules to allow incoming traffic on port 8080, etc...