Monday, May 27, 2013

empty $_SERVER['SERVER_NAME'] php variable. Let Nginx support any wildcard domains hostname

empty $_SERVER['SERVER_NAME'] php variable. Let Nginx support any wildcard domains hostname

# vim /usr/local/etc/nginx/nginx.conf
### make sure server_name variable is commented out.
#server_name localhost;

### add this line
fastcgi_param SERVER_NAME $http_host;