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.

closed as off-topic by kasperd, Ward, womble May 2 '16 at 7:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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 9 '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 9 '12 at 19:31

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


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.

  • 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 9 '12 at 19:17
  • It's probably coming in for a different server block, perhaps the default server. – Michael Hampton Aug 9 '12 at 19:18
  • But I only have 1 server block. – gerky Aug 9 '12 at 19:33

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"

Not the answer you're looking for? Browse other questions tagged or ask your own question.