server_name ip_adress?

Nuno Magalhães nunomagalhaes at
Fri Jul 3 01:08:37 MSD 2009


This is a very basic question i haven't found an answer to. I have a
few virtual hosts, all under /path/to/nginxhtdocs/vhost1, vhost2, etc.
I want to set a catch-all so that if no server matches the request or
is someone uses the IP (namely me) they get the default server.

After a bunch of variations i'm using server_name  _ ""; with a server
root of /path/to/nginxhtdocs but if i use the IP address to access it,
i get one of my vhosts. I assume it does this because it fails to
assume 'default' as a valid catch-all and the vhost it uses is the
first, alphabetically.

All i really want is to have other subfolders i want to access every
now and then, without a domain, so, just for
testing purposes.

Is this achievable or do i always need a domain?

Nuno Magalhães

()  ascii ribbon campaign - against html e-mail
/\  ascii-rubanda kampajno - kontraŭ html-a retpoŝto

More information about the nginx mailing list