Second domain config does not redirect www traffic

Francis Daly francis at
Thu Feb 19 08:05:23 UTC 2015

On Thu, Feb 19, 2015 at 01:59:03AM -0500, macmichael01 wrote:

> Here is my nginx config:

It is usually better to include the config in the mail; that url is
unlikely to be accessible wherever the mail archives are read.

But I looked at it anyway.

Your config is syntactically correct, but semantically incorrect.

You're missing a semicolon on line 31.

  server {
    listen 80;
    return 301$request_uri;

This defines a port 80 listener with four server_name values and no
extra handling for requests.

(See also line 6.)

> Does conf loading order matter?

If you use directives that care about order, yes. If you let nginx use
order to determine defaults, yes. Otherwise, no.

And current nginx loads "*"-matches alphabetically.

> Could this be a DNS issue?

If your log file shows that the request is getting to nginx, no.

Francis Daly        francis at

More information about the nginx mailing list