-1

I am having problems with my Rails application that will use Nginx and Passenger. I've already deployed the application and have setup the nginx config file as such:

server {
   listen 80;
   server_name www.example.com;
   root /home/johndoe/test_app/current/public;
   passenger_enabled on;
   ...
}

I've already set up the name servers of the domain and added the entry on my provider. However, all I'm seeing is the Welcome to Nginx page. I've checked the nginx error log and I just saw this, not sure what it means and why it's searching for that file.

[error] 8492#0: *7 open() "/opt/nginx/html/favicon.ico" failed (2: No such file or directory)

Any help would be very much appreciated. Thanks.

Jenny D
  • 27,780
  • 21
  • 75
  • 114
gerky
  • 291
  • 1
  • 4
  • 14
  • You're reloaded/restarted nginx, right? And your server block is being included when nginx reads the configuration files (i.e., the site is enabled with a symlink on Ubuntu systems)? – cjc Aug 09 '12 at 19:28
  • Yes, I've restarted nginx multiple times. I'm not sure if the server block is being included for certain though, is there a way I can check? – gerky Aug 09 '12 at 19:31

3 Answers3

2

Turns out I have to define it in a separate server block. Worked great. Found the answer here: https://stackoverflow.com/questions/9824328/why-is-nginx-responding-to-any-domain-name

gerky
  • 291
  • 1
  • 4
  • 14
1

That error means your site doesn't have a favicon.ico file for showing a favicon. If you don't want a favicon, you can safely ignore it.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • I don't quite understand why it goes to /opt/nginx/html/favicon.ico. Is it looking for the index page there? I've already set a root location for the server name in the server block. Am i missing something? – gerky Aug 09 '12 at 19:17
  • It's probably coming in for a different `server` block, perhaps the default server. – Michael Hampton Aug 09 '12 at 19:18
  • But I only have 1 server block. – gerky Aug 09 '12 at 19:33
1

Verify following configuration should be comment out in nginx.conf

sudo gedit /opt/nginx/conf/nginx.conf

    # location / {
    #     root   html;
    #     index  index.html index.htm;
    # }

This fix your problem of "Rails application only showing Nginx default page"

rahul patil
  • 111
  • 2