Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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(?) ?

share|improve this question

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 --dport 8080 -j DNAT --to-destination <alias.ip>:80

This will forward incoming requests to port 8080 on IP address to port 80 on your alias IP. Obviously for this to work, the public DNS must point to, 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...

share|improve this answer
And how to explain this - from server where I am installing "alias.ip" I can access my own www, but from home machine - can't. For sure that no forwarding is required? – zion May 26 '11 at 22:09
OK, it's time for you to update your original post with some more information about the networks involved here, and the IP addresses used. Are your home machine and the server hosting the site on the same network? – wolfgangsz May 26 '11 at 22:39
Server hosting! Can't access from outside. – zion May 27 '11 at 1:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.