Setting up passenger with nginx to serve ruby on rails app - create a current directory? - create a symlink?

22 views
Skip to first unread message

fugee ohu

unread,
Sep 16, 2015, 5:23:40 PM9/16/15
to Phusion Passenger Discussions
Trying to get my rails app into production with nginx and passenger I can't get this to work Am I supposed to create a current directory between my app and it's public directory? Do I need to create a symlink it too? I get 403 or 404 depending on whether or not I use the current directory or put public back where it was Here's my server definition from nginx.conf

server {
   listen 80 default accept_filter=httpready;
   listen [::]:80 default_server ipv6only=on;
   server_name www.myhostname.com;
   charset utf-8;
   root /usr/home/username/websites/myhostname/public;
   rails_env production;
   passenger_enabled on;
   }

Hongli Lai

unread,
Sep 16, 2015, 8:21:42 PM9/16/15
to phusion-passenger
On Thu, Sep 17, 2015 at 5:23 AM, fugee ohu <fuge...@gmail.com> wrote:
> Trying to get my rails app into production with nginx and passenger I can't
> get this to work Am I supposed to create a current directory between my app
> and it's public directory?

No.

> Do I need to create a symlink it too?

No.

> I get 403
> or 404 depending on whether or not I use the current directory or put public
> back where it was Here's my server definition from nginx.conf
>
> server {
> listen 80 default accept_filter=httpready;
> listen [::]:80 default_server ipv6only=on;
> server_name www.myhostname.com;
> charset utf-8;
> root /usr/home/username/websites/myhostname/public;
> rails_env production;
> passenger_enabled on;
> }

This configuration block looks correct (though the rails_env is
redundant, as it defaults to production).

Can you check your global Nginx log to check whether Passenger has
printed any errors?

--
Phusion B.V. | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 63501007 (The Netherlands)
Reply all
Reply to author
Forward
0 new messages