Why is nginx doing this?
The reason for this is simple. Very old or broken clients do not send the
Host HTTP header field in their requests and if you are using name based server blocks (name based virtual hosts in Apache terms) nginx is not able to determine which of the servers you configured is meant by the client. The same problem is true for any other web server that supports this name based system. This problem would not arise if you would be using an IP based system for each domain (which also means that you have several network interfaces).
More on this topic? How nginx processes a request
Which is the first?
nginx will select the server that comes first if no
default flag was set on any
server1.com will be default.
If you automatically include the symbolic links from
sites-enabled (default config) the file that comes first in the directory will be your first server.
What can I do to prevent this?
Good question and you should prevent it. There is no reason to support these old clients and absolutely no reason to support broken clients. The problem is easily solved by creating a default catch all server config. The following example is from one of my projects and targeted towards the current dev version of nginx (1.5.2 - but should work with older versions as well):
# Default server for clients who do not send correct Host header.
# The underline in the file name makes sure that this file comes first in the dir.
listen *:80 default_server deferred;
Configuration is trimmed: full config