Welcome! Log In Create A New Profile

Advanced

Default virtual server & server sequence in nginx.conf

alf
April 13, 2009 11:15AM
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.

alf :)
Subject Author Posted

Default virtual server & server sequence in nginx.conf

alf April 13, 2009 11:15AM

Re: Default virtual server & server sequence in nginx.conf

deltay April 13, 2009 11:37AM

Re: Default virtual server & server sequence in nginx.conf

SSSlippy April 13, 2009 02:39PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 85
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready