I know there are about 100 questions about this, but after hours of research, I couldn't find my solution. Here's my nginx config:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/LucyRb/public;
passenger_enabled on;
passenger_app_env production;
index index.html index.htm;
server_name <domain name>;
location / {
try_files $uri $uri/ /index.html;
passenger_enabled on;
}
}
My /public
directiory:
root@Lucy:/var/www/LucyRb/public# namei -l *
f: 404.html
-rwxrwxrwx root root 404.html
f: 422.html
-rwxrwxrwx root root 422.html
f: 500.html
-rwxrwxrwx root root 500.html
f: favicon.ico
-rwxrwxrwx root root favicon.ico
f: robots.txt
-rwxrwxrwx root root robots.txt
I don't think it's a permission problem. I've already run rake db:migrate
to create the database, and it worked. I'm pretty sure environments are set up properly. All I get is a file listing (since autoindex is on, otherwise I get a 403). But routes, nor does the app default index/root, work. I've read the Passenger documentation, and I tried troubleshooting with the docs and other SO questions, but I can't seem to get this working.
I haven't forgotten to bundle install
and all the proper packages are installed, I'm pretty sure (did I forget any? mysql
, rvm
and its relevant steps for installing rails, nginx
, passenger
... Probably another 2-3).
I know I'm not supposed to start rails server
because it will only allow 1 connection at a time. So nginx is supposed to do that properly, right? Or is that what I'm supposed to do with certain flags?
Thanks in advance.