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.

Nginx and subdomains issue

Hi, Here's my configuration

server {
  listen 80;
  server_name  my_server.com www.my_server.com demo.my_server.com;
   location / {
      proxy_pass http://123.456.789.10:8080/;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

I'm wondering why if I point the browser to: my_server.com or www.my_server.com everything's fine, but if I go to demo.my_server.com, firefox can't find the server at demo.my_server.com.

Hints? TIA

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If the issue is an inability to find the server at demo.my_server.com, then you almost certainly don't have demo.my_server.com in DNS. This can be checked by running

nslookup demo.my_server.com

on windows, or

dig A demo.my_server.com

on (Li|U)nix. To fix this, you'll need to add demo.my_server.com to DNS as an A record, with the same value as www.my_server.com.

share|improve this answer
    
You are right Cian, I have to add demo.my_server.com as an A record. –  Argo Jul 31 '13 at 12:34

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.