View Single Post
Old 9th July 2013, 20:10
cbj4074 cbj4074 is offline
Senior Member
Join Date: Nov 2010
Posts: 395
Thanks: 30
Thanked 58 Times in 50 Posts

Okay, so I modified the main domain name so that it includes the www. To be clear, I changed it from "" to "" in the Clients -> Domains interface.

(It is important to note that I have on this server, too, which is a completely unrelated domain.)

This "fixes" the problem of the CGI "SERVER_NAME" variable lacking the www prefix (it now reflects "", as expected), but there is an unintended side-effect: SEO redirects no longer function as expected.

After making this change, if I try to browse to (without the www), the SEO redirect, which I have set to "domain.tld => www.domain.tld", is not effective.

Not only is the redirect not effective, but browsing to redirects me to, which is a very bad scenario in a production environment. Visitors to one client's site see a different client's site.

I assume that this occurs because a symlink for doesn't actually exist in /etc/nginx/sites-available (nor should it; the symlink name is now, so nginx redirects the request to the "first domain, alphabetically, with a '100-' prefix" with no regard whatsoever for any SEO redirect that might be set for (e.g., "domain.tld => www.domain.tld").

Is this a case of "operator error"? Or is this an actual problem/bug?

Again, all I want is for the CGI variable "SERVER_NAME" to include the "www" prefix, without having to include the www subdomain in the main domain name. Not only is including the www in the main domain name redundant when SEO redirect is set, but doing this causes the SEO redirects to stop functioning altogether.

I suppose my only option is to add custom nginx configuration directives to set the SERVER_NAME manually, e.g., change:

fastcgi_param	SERVER_NAME		$server_name;

fastcgi_param	SERVER_NAME		www.$server_name;
(I haven't actually tested the above syntax, either.)
Reply With Quote