Where is third level of domain gone

Igor Sysoev is at rambler-co.ru
Wed Jun 17 14:10:38 MSD 2009


On Wed, Jun 17, 2009 at 12:58:07PM +0400, Maxim Dounin wrote:

> Hello!
> 
> On Wed, Jun 17, 2009 at 03:33:52PM +0800, fei dong wrote:
> 
> > Hello,
> > 
> > I am using Nginx 0.7.54 with php 5.2.8 as the web server. When I configure
> > the host name, like: *.music.goog.com, I find a very wield phenonmenon that
> > I can't get the third level of this domain.
> > 
> > I print this variable in php:
> > $_SERVER['SERVER_NAME'] ; it says: music.goog.com
> 
> SERVER_NAME is server's name, not Host header from client request.  
> Use HTTP_HOST instead.

If he uses fastcgi, then he may use

-    fastcgi_param  SERVER_NAME        $server_name;
+    fastcgi_param  SERVER_NAME        $host;


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list