Setup: Passenger with Nginx for a rails app on EC2

594 views
Skip to first unread message

gau...@pracly.com

unread,
Aug 10, 2016, 3:26:37 AM8/10/16
to Phusion Passenger Discussions
Struggling with this setup.
Following is the output of a few commands which may help diagnose the problem.

curl http://XX.XX.XX.XX/
curl: (7) Failed to connect to XX.XX.XX.XX port 80: Connection timed out
---------------------------------------------------------------------------------------------------------
passenger-config validate-install
 * Checking whether this Passenger install is in PATH... ✓
 * Checking whether there are no other Passenger installations... ✓

Everything looks good. :-)
---------------------------------------------------------------------------------------------------------
passenger-status
Version : 5.0.30
Date    : 2016-08-10 12:16:10 +0530
Instance: j0dyUwbr (nginx/1.10.1 Phusion_Passenger/5.0.30)

Phusion Passenger is currently not serving any applications.
---------------------------------------------------------------------------------------------------------


Any help would be greatly appreciated!

Camden Narzt

unread,
Aug 10, 2016, 12:03:24 PM8/10/16
to Phusion Passenger Discussions
How did you start nginx? What does your nginx config look like?

Cam

gau...@pracly.com

unread,
Aug 10, 2016, 7:56:40 PM8/10/16
to Phusion Passenger Discussions
Just like the guide said, I put this in /etc/nginx/sites-enabled/myapp.conf

server {
    listen 80;
    server_name yourserver.com;

    # Tell Nginx and Passenger where your app's 'public' directory is
    root /var/www/myapp/code/public;

    # Turn on Passenger
    passenger_enabled on;
    passenger_ruby /path-to-ruby;
}

replaced yourserver.com with the IP of my EC2 instance, /var/www/myapp/code/public with the path of my app's public directory and /path-to-ruby with the path of my rvm ruby installation as seen by running the command passenger-config about ruby-command

and then did 

sudo service nginx restart

I have since restarted nginx multiple times (doing some trial and error) and also restarted the instance a couple of times. 

Appreciate your help, thanks :)

gau...@pracly.com

unread,
Aug 12, 2016, 5:20:47 AM8/12/16
to Phusion Passenger Discussions
After spending hours playing around with nginx and passenger config, I found the problem.. my security group in ec2 didn't have port 80 open for incoming requests :/ 
So silly!!
Reply all
Reply to author
Forward
0 new messages