nginx+passenger +static websites= problems

Posted by Eugene K on Server Fault See other posts from Server Fault or by Eugene K
Published on 2012-12-09T03:55:32Z Indexed on 2012/12/09 5:06 UTC
Read the original article Hit count: 554

Filed under:
|

I've got a Rails app that nginx serves through passenger. I'd also like to serve some static content for a different domain name. But when I add another server block to my config, both websites become unavailable returning HTTP 204. What have I done wrong? What can I do to fix it?

Here's the http block of my nginx.conf: https://gist.github.com/4243256

Here's what I added :

server {
        listen 80;
        server_name website2;
        root /var/www/website2;
        location / {
           index index.html;
         }
       }

It's going to be a Rails app as well at some point in the future (though I'm not really sure about that, maybe I'm going to use a different back-end solution.) Either way, I don't want anything dynamic to eat away the resources just yet.

As of now, this website consists of nothing but index.html and stylesheet.css files in the root directory. What should I do?

Thank you in advance. Sincerely yours, Eugene.

© Server Fault or respective owner

Related posts about nginx

Related posts about phusion-passenger