multiple server_name entries not working with FastCGI?

Michael nginx at thismetalsky.org
Wed Jun 11 19:46:22 MSD 2008


On Tue, Jun 10, 2008 at 14:20:35, Michael said...

> If I browse to http://test.domain.com/ the FastCGI app runs fine.
> 
> If I browse to http://test/ it doesn't, at all, a blank page is shown.
> 
> Removing the FastCGI app, and using an index.html, both of these work properly.

I worked around this problem like so:

server_name test test.domain.com;

if ($host !~ \.domain\.com) {
	rewrite ^(.*)$ http://$host.domain.com$1 permanent;
}

Odd that I had to do this.

-- 
Michael 
PGP: 1024D/BC3FF6D4 2BC2 A79B 88D1 218A B32B  ED7A 2EC2 1206 BC3F F6D4
"Somewhere, something incredible is waiting to be known."
 - Carl Sagan





More information about the nginx mailing list