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

I set up many domains but I dont know how to configure if only ip address is given.

say foo.com I have a setup to go web/foo.com/htdocs, I want to 88.99.66.55 ip address like a domain to web/fook.com/htdocs

server {
    listen       80;
    server_name  85.99.66.55;
    location / {
            root  /home/web/fook.com/htdocs;
    }
 location ~ \.(php|php3|php4|php5)$ {
                root          /home/web/fook.com/htdocs;
                include       fastcgi_params;
                fastcgi_pass  127.0.0.1:9000;
        }
    }

resulted

  [warn]: conflicting server name "85.105.65.219" on 0.0.0.0:80, ignored
share|improve this question

1 Answer 1

The IP 0.0.0.0 means all IPs. So what I think you want is something more like:

server {
    listen       85.99.66.55:80;
    server_name *.fook.com
    location / {
            root  /home/web/fook.com/htdocs;
    }


  server {
        listen       85.99.66.55:80;
        server_name *.arf.com
        location / {
                root  /home/web/arf.com/htdocs;
        }

You want to keep your network layers straight here. server_name is for the HOST header in the HTTP (Layer 7) request where as Listen is for IP and Port -- the network and transport layers, or the IP and TCP Packets (Layers 3 and 4).

share|improve this answer
    
but Other vhosts should work on that ip. I'll try that when I go work. –  nerkn Oct 26 '10 at 20:51
    
Updated it with what I think it might be ... untested though. –  Kyle Brandt Oct 26 '10 at 21:03
    
";" are missing from server_name "xxx" directive –  Alekc Jul 11 '12 at 10:37

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.