S
S
Semyon Semyonov2014-07-14 16:49:36
Nginx
Semyon Semyonov, 2014-07-14 16:49:36

How to tell nginx and rails to use port 80?

There are several problems (or maybe one).
I'm trying to run a rails app on port 80 and it's empty:

[email protected]:/var/www/apps/testapp$ rails server -d -e production -p 80
=> Rails 3.2.8 application starting in production on http://0.0.0.0:80
[email protected]:/var/www/apps/testapp$ 
[email protected]:/var/www/apps/testapp$ lsof -wni tcp:80
[email protected]:/var/www/apps/testapp$

I brake and start on port 3000 - everything is fine and I can go to mytestapp.com: 3000
However, nginx is configured to listen on port 80
server {
    charset utf-8;
    listen 80;
    server_name mytestapp.com;
    root /var/www/apps/testapp/;
...

What am I doing wrong?
PS It's probably worth adding that I'm not running as root.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Vsk, 2014-07-14
@viktorvsk

Do you start rails server when you have nginx running? Then, I think, and there is no result With the
config that you brought, you want to send rails through nginx? Well, at least, probably, you need to hover over the public folder. Secondly, this is usually done through a proxy

@
@proffard, 2014-07-14
_

try via
(without nginx)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question