Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have one ip number to use, and want to share it with several domains. I have separate, but the other domains I have a script to display content based on the domain. I've moved to a new server, and I'm using nginx 1.0.6. This worked as desired on the old server with nginx 0.8.54. The problem is all domain names pointed at are always showing (the first server block) instead of falling to the wildcard server block. How can I modify this to work as desired?

server {
    root /home/www/;

server {
    server_name _;
    root /var/www;
share|improve this question
up vote 3 down vote accepted

Either move your fallback server block above the block with specific domains, or change your listen to listen default_server;.

share|improve this answer

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.