URLs built using SERVER_NAME will return the wrong host on nginx servers

I'm really surprised this hasn't been reported yet, given the growth of nginx over the last 6 months.

Apache and nginx are going to report SERVER_NAME differently. nginx will always report the first name that's defined in the host file. The Domain Mapping plugin uses SERVER_NAME to generate the redirect urls, E.g. for forcing https.

Effectively, this means if you go to http://sub.domain.com, it'll force it to https://domain.com instead of https://sub.domain.com like it should.

We overrode this behavior by explicitly setting SERVER_NAME programatically. However, you may want to switch to HTTP_HOST so it is compatible with nginx.