Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

There are a lot of moving parts here that I have varying levels of familiarity with, so I'm hoping another set of eyes will help me discover why I'm getting a 404 after deploying my Rails app on Nginx running Phusion Passenger.

My app's /public directory currently resides at:

$pwd
>> /root/public_html/photobook/public

My server settings in nginx.conf:

server {
  listen 80;
  server_name pb.mysite.com;
  root /root/public_html/photobook/public;   # <--- be sure to point to 'public'!
  passenger_enabled on;
}

But after restarting nginx:

sudo /opt/nginx/sbin/nginx

Going to my browser displays a 404 page served up by Nginx.

Are there rules for handling subdomains differently than I'm not aware of? Or is this something else entirely?

Also, since I'm new to Passenger on Nginx, is there a log file I should find that might give me more helpful feedback on the 404, like what page it's looking up?

Thanks!

Edit

First, thanks for the advice on /var/log.

I didn't know about it; this will be a great help in the future.

I'm not sure my syslogs (I have two that appear current and then it looks like .gz backups going back) are recording anything relevant, however:

Jun 23 01:25:01 myusername /USR/SBIN/CRON[11379]: 
(root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Jun 23 01:49:01 myusername -- MARK --

Just that, the hourly cron task and whatever -- MARK -- is for, all the way back. Any ideas?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Check under /var/log. Unless you have an nginx or passenger log, everything will be under syslog.

Your next step will depend on what you see there. If the solution isn't readily apparent, post your log as nginx starts cold so we can get a better clue as to where to go next.

EDIT:

Since you have nginx under /opt, take a look under /opt/nginx/logs/error.log.

Also, you'll want to take your app out of /root as it can cause nginx to mis-read the path if you run nginx as root.

Lastly, consider creating an nginx user to run nginx to limit your exposure to baddies.

share|improve this answer
    
What Linux/Unix distro are you running and did you install nginx via package management or source? –  Shazburg Jun 23 '09 at 3:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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