Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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...

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

 
discard

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.