Hi,
i’m trying to set up a RoR + Nginx/Passenger environment, using this tutorial : https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
However, i’m facing this following issue : despite the fact that my rails server is running, i can not see any page if i go to http://my_IP_address:3000.
As mentionned in the tutorial, i’ve modified my Nginx configuration file as followed :
server {
listen 127.0.0.1:3000 default_server;
#server_name example.com;
passenger_enabled on;
passenger_app_env development;
root /home/rails/testapp/public;
}
This is what i get when i do a :
root@ubuntu-s-1vcpu-1gb-ams3-01:/home/rails/testapp# netstat -plant
–>
Active Internet connections (servers and established)
Proto
Recv-Q
Send-Q
Local Address
Foreign Address
State
PID/Program name
tcp
0
0 0.0.0.0:80
0.0.0.0:*
LISTEN
12469/nginx: master
tcp
0
0
127.0.0.53:53
0.0.0.0:*
LISTEN
26794/systemd-resol
tcp
0
0
0.0.0.0:22
0.0.0.0:*
LISTEN
953/sshd
tcp
0
0
127.0.0.1:3000
0.0.0.0:*
LISTEN
30875/puma 4.3.1 (t
tcp
0
0
178.62.224.137:22
86.208.49.163:53641
ESTABLISHED 30568/sshd: rails [
tcp
0
464
178.62.224.137:22
86.208.49.163:53226
ESTABLISHED 27641/sshd: root@pt
tcp
0
0
178.62.224.137:22
86.208.49.163:52900
ESTABLISHED 22558/sshd: root@no
tcp6
0
0
:::22
:::*
LISTEN
953/sshd
tcp6
0
0
::1:3000
:::*
LISTEN
30875/puma 4.3.1 (t
Is there somebody who could help me please ?
Thank you very much Geoffrey
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Hello,
You would need to setup Nginx as a reverse proxy for your Passenger application. You can follow this guide here on how to setup Nginx as a reverse proxy:
https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-18-04-server
You can skip the first few steps and start from step 6. The important part is the
proxy_pass
configuration.On another note, you can not have 2 services listening on the same port, for example, if your Passenger is listening on port
3000
you can not set Nginx to listen on port3000
as well as one of the services would not be able to start.Hope that this helps! Regards, Bobby