<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Possible bug in value of $server_name variable</title>
<description>I have &amp;quot;server_name *.domain.tld&amp;quot; in my config file and tried to get the correct virtual host the user connected to with the help of a php script but &amp;quot;$_SERVER['SERVER_NAME']&amp;quot; returned &amp;quot;*.domain.tld&amp;quot; instead of &amp;quot;something.domain.tld&amp;quot; when I connect to it.

When I use &amp;quot;.domain.tld&amp;quot; instead of &amp;quot;*.domain.tld&amp;quot; I get &amp;quot;domain.tld&amp;quot; as the hostname.

Is this is bug or how to get the real hostname the user connect to ?</description><link>http://forum.nginx.org/read.php?2,223642,223642#msg-223642</link><lastBuildDate>Sun, 19 May 2013 20:56:11 -0400</lastBuildDate>
<generator>Phorum 5.2.16</generator>
<item>
<guid>http://forum.nginx.org/read.php?2,223642,223643#msg-223643</guid>
<title>Re: Possible bug in value of $server_name variable</title><link>http://forum.nginx.org/read.php?2,223642,223643#msg-223643</link><description><![CDATA[On Thu, Mar 08, 2012 at 12:55:15PM -0500, Kaimei wrote:<br /><br />Hi there,<br /><br />&gt; Is this is bug or how to get the real hostname the user connect to ?<br /><br />The nginx variable $server_name is the first name in the server_name<br />directive list.<br /><br />The nginx variable $http_host is the Host: header sent by the client.<br /><br />The nginx variable $host is $http_host if it is defined, and $server_name<br />if not.<br /><br />The typical nginx fastcgi configuration will set SERVER_NAME to<br />$server_name (within fastcgi.conf) and HTTP_HOST to http_host (because<br />that's what happens to client headers). So you can check those in<br />your script.<br /><br />If you wish, you can add your own &quot;fastcgi_param HOST $host&quot; setting<br />and check that, or you could set SERVER_NAME to be $host and continue<br />checking that one.<br /><br />f<br />--<br />Francis Daly francis@daoine.org<br /><br />_______________________________________________<br />nginx mailing list<br />nginx@nginx.org<br />http://mailman.nginx.org/mailman/listinfo/nginx]]></description>
<dc:creator>Francis Daly</dc:creator>
<category>Nginx Mailing List - English</category><pubDate>Thu, 08 Mar 2012 13:42:00 -0500</pubDate></item>
<item>
<guid>http://forum.nginx.org/read.php?2,223642,223642#msg-223642</guid>
<title>Possible bug in value of $server_name variable</title><link>http://forum.nginx.org/read.php?2,223642,223642#msg-223642</link><description><![CDATA[I have &quot;server_name *.domain.tld&quot; in my config file and tried to get the correct virtual host the user connected to with the help of a php script but &quot;$_SERVER['SERVER_NAME']&quot; returned &quot;*.domain.tld&quot; instead of &quot;something.domain.tld&quot; when I connect to it.<br /><br />When I use &quot;.domain.tld&quot; instead of &quot;*.domain.tld&quot; I get &quot;domain.tld&quot; as the hostname.<br /><br />Is this is bug or how to get the real hostname the user connect to ?]]></description>
<dc:creator>Kaimei</dc:creator>
<category>Nginx Mailing List - English</category><pubDate>Thu, 08 Mar 2012 12:55:15 -0500</pubDate></item>
</channel>
</rss>