[wp-trac] [WordPress Trac] #25239: $_SERVER['SERVER_NAME'] not a reliable when generating email host names
WordPress Trac
noreply at wordpress.org
Fri Sep 6 15:34:49 UTC 2013
#25239: $_SERVER['SERVER_NAME'] not a reliable when generating email host names
-------------------------------------------------+-------------------------
Reporter: layotte | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
Component: Mail | Review
Severity: normal | Version: trunk
Keywords: has-patch dev-feedback needs- | Resolution:
testing |
-------------------------------------------------+-------------------------
Comment (by nacin):
nginx has an odd quirk that, given:
`server_name example.com blog.example.com microsite.example.com;`
And:
`fastcgi_param SERVER_NAME $server_name;`
When accessing microsite.example.com, SERVER_NAME will be set to
example.com. This is akin to always using ServerName in Apache, rather
than using ServerAlias (which is what happens).
I agree that SERVER_NAME should not be used, as depending on the setup it
is not going to match HTTP_HOST. That said, if you are using a catchall
like `_` (it is actually meaningless, any special character will do), you
should consider doing something like `set $name X` in your server block to
ensure $server_name is what you want it to be, or actuall change the
`fastcgi_param` call to set SERVER_NAME to `$host`. That will fix your
issues.
So, this isn't a duplicate of #16805 — rather, we should investigate and
consider a switch to HTTP_HOST here.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25239#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list