3

I developed a Ruby website and in order to deploy it, I followed this tutorial. Everything went well, but I skipped all user switching operations because I really didn't see the point of it, and to be honest maybe this is the problem.

My problem is that the server is running, as we can see here

And I can do a successful curl on it using the local machine, but I can't access it online.

To be honest, it's the first time I'm deploying a website ever so I'm sure I'm just missing an obvious thing (a DNS maybe), but I don't really know what.

The problem might also come from the fact that I'm using the passenger and Nginx binaries given by the passenger gem installed. I didn't install passenger and Nginx on my system so it's using the binaries from the gem.

EDIT:

Thanks all for the current answers, I think the problème, as stated by the first comment under this question is that I'm not using the default server port configured by Nginx but another one, so I'm gonna try to add my port in the Nginx config file.

And to clarify a bit, because I don't have a server name, I'm running my tests using :

curl ipaddress:port

EDIT 2:

I just tried looking at the config file and it appears that the passenger is generating an Nginx config file (because it uses its own Nginx standalone binary to run) that looks like that, so the port must not be not the problem.
Maybe I really have no choice but to use port:80 but now I'm not even sure if I can ping the Nginx standalone from outside my VM, I'm a total beginner with Nginx

EDIT 3:

A netstat gives me this this

So the nginx server is really running, but how can I access it? Because curl ipaddress:8080 (I changed the port since the first try with 90 and replaced it with 8080) is not working. But on the local machine a curl on 0.0.0.0:8080 is still working.

Lidor shimoni
  • 93
  • 1
  • 9
baldash
  • 307
  • 5
  • 17
  • 1
    Your server listens port :90, not :80 as the tutorial mentioned (and which is the default one for HTTP protocol) - do you take this fact into account when you're trying to access your app? – Konstantin Strukov Nov 02 '20 at 11:47
  • Yes but the problem is this is on a google VM and the google services also run on port 80 so I can't run it on the same port, any ideas ? – baldash Nov 02 '20 at 12:15
  • It is the default but is it mandatory to put the website on this port or is there an alternative way ? – baldash Nov 02 '20 at 14:52
  • When you use a non-default port then you have to add that port to the domain in the browser - like `http://www.my-domain.tld:90/` – spickermann Nov 02 '20 at 17:40
  • I tried by using curl http://ipaddress:90/ because i have no domain name, but it didn't worked. I'm gonna try to change the nginx config fule because the port I'm setting in the passenger file is not listed as a server default in the nginx config file. – baldash Nov 03 '20 at 09:07
  • 1
    "_this is on a google VM_" There's the problem. Most likely, you are not allowed to make inbound connections to that VM on that port. Either explain in excruciating detail _how you configured this to run in Google_ or refer to the documentation for the Google product you're using to ensure your network ports have been opened for external connections. – anothermh Nov 04 '20 at 21:45
  • 1
    Start here: https://stackoverflow.com/a/21068402/3784008 – anothermh Nov 04 '20 at 21:46

0 Answers0