3 messages in ru.sysoev.nginxDefault virtual server & server seque...
FromSent OnAttachments
alfApr 13, 2009 8:15 am 
Delta YehApr 13, 2009 8:37 am 
SSSlippyApr 13, 2009 11:39 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Default virtual server & server sequence in nginx.confActions...
From:alf (ngin@nginx.us)
Date:Apr 13, 2009 8:15:28 am
List:ru.sysoev.nginx

Hello :)

I have been trying to wrap my head around this, read a lot of docs, but I just
cant seem to understand, so if anyone could enlighten me.

My example:

I want to set up a default virtual server (vhost) and a spesific vhost.

1. Does the sequence of these two server blocks in the nginx.conf matter?

2. I tried something like this:

server { listen 80; server_name mydomain.com; index mydomain.html; }

server { listen 80 default; server_name _; index default.html; }

but now mydomain.com allways shows default.html. if i remove "default" and put
that same (the second) server on the top it all works fine..

I would really like to know what is really going on here behind the scenes, any
info much apresiated.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,1013,1013#msg-1013