Multiple server_name entries not working with FastCGI?

I probably just overlooked something in the documentation…

I have the following config (sans less relevant things):

server {
server_name test.domain.com test;

location / {
fastcgi_pass 127.0.0.1:10001;
}
}

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.

What did I miss?

On Wed, Jun 11, 2008 at 11:46:22AM -0400, Michael wrote:

server_name test test.domain.com;

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

Odd that I had to do this.

Probably FastCGI server is not configured to work with short name.

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.

On Wed, Jun 11, 2008 at 22:14:30, Igor S. said…

Probably FastCGI server is not configured to work with short name.
The FastCGI server in question doesn’t care what the name is at all.