boxen/puppet-nginx — pull request #8 by toolbear (2013-04-07 04:48:59+00:00)
Title: Prefer public site over ones in sites/*

The default server for nginx is the first `server` block it encounters. The first site matching the `sites/*` glob becomes the default server because this:

include <%= scope.lookupvar "nginx::config::sitesdir" %>/*;

precedes this:

server {
listen 80;
server_name localhost;

location / {
root <%= scope.lookupvar "nginx::config::configdir" %>/public;
}
}

This isn't apparent when you're own your own box, say it's *ralph*, fetching http://localhost/ or http://something.dev/. However, from another box on your network, fetching http://ralph.local./ will get the default site. This change makes that always be the "public" site.

This is possibly a breaking change for anyone who is relying on the first match in `sites` to be accessible to external hosts. But I think that's rather brittle behavior to be depending on already.