# Multiple server\_name entries not working with FastCGI?

**URL:** <https://www.ruby-forum.com/t/multiple-server-name-entries-not-working-with-fastcgi/140096>\
**Category:** NGINX\
**Created:** [June 10, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/multiple-server-name-entries-not-working-with-fastcgi/140096 "2008-06-10T20:30:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [June 10, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/multiple-server-name-entries-not-working-with-fastcgi/140096/1 "2008-06-10T20:30:51Z")

</div>

I probably just overlooked something in the documentation…

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

server {  
server\_name [test.domain.com](http://test.domain.com) test;

location / {  
fastcgi\_pass 127.0.0.1:10001;  
}  
}

If I browse to [http://test.domain.com/](http://test.domain.com/) the FastCGI app runs fine.

If I browse to [http://test/](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?

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [June 11, 2008, 8:25pm UTC](https://www.ruby-forum.com/t/multiple-server-name-entries-not-working-with-fastcgi/140096/2 "2008-06-11T20:25:24Z")

</div>

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

> server\_name test [test.domain.com](http://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.

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [June 11, 2008, 5:59pm UTC](https://www.ruby-forum.com/t/multiple-server-name-entries-not-working-with-fastcgi/140096/3 "2008-06-11T17:59:11Z")

</div>

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

> If I browse to [http://test.domain.com/](http://test.domain.com/) the FastCGI app runs fine.
> 
> If I browse to [http://test/](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](http://test.domain.com);

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

Odd that I had to do this.

---

<div class="post-metadata">

**Author:** ![michael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@michael](https://www.ruby-forum.com/u/michael)\
**Post date:** [June 11, 2008, 11:45pm UTC](https://www.ruby-forum.com/t/multiple-server-name-entries-not-working-with-fastcgi/140096/4 "2008-06-11T23:45:25Z")

</div>

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.
