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.

i have this config in sites-enabled/default

upstream domainone.com.ar {
    server 127.0.0.1:9000;
}
server {
listen   80;
server_name  www.domainone.com.ar;
rewrite ^/(.*) http://domainone.com.ar/$1 permanent;
}
server {
    listen 80;
    listen [::]:80 ipv6only=on;
    server_name domainone.com.ar;
    #access_log /var/log/nginx/example1.com/access.log;
    location / {
      if ($request_uri ~* \.(ico|css|js|gif|jpe?g|png)$) {
          expires 168h; 
          break;
      }
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-NginX-Proxy true;
      proxy_pass http://domainone.com.ar;
      proxy_redirect off;
    }
}


upstream domaintwo.com.ar {
    server 127.0.0.1:8000;
}
server {
listen   80;
server_name  domaintwo.com.ar;
rewrite ^/(.*) http://domaintwo.com.ar/$1 permanent;
}
server {
    listen 80;
    listen [::]:80 ipv6only=on;
    server_name www.domaintwo.com.ar;
    #access_log /var/log/nginx/example1.com/access.log;
    location / {
      if ($request_uri ~* \.(ico|css|js|gif|jpe?g|png)$) {
          expires 168h; 
          break;
      }
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-NginX-Proxy true;
      proxy_pass http://domaintwo.com.ar;
      proxy_redirect off;
    }
}

when i try to /etc/init.d/nginx start... nothing happends... no error no log no nothing... my server is a cloud server debian 6, 64bits nodejs v0.10 nginx 1.2.6 there is something wrong with config??

share|improve this question

1 Answer 1

If you don't need IPv6 you must comment out line 11 and 39 (listen [::]:80 ipv6only=on;). Otherwise you you must remove ipv6only=on directive

share|improve this answer

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.