NGINX on its own cannot "run" Rails, because it is a simple httpd server. Rails needs an application server -- puma, unicorn, passenger -- to be a bridge between http and Rack protocols. Rails is a Rack application, under all the layers, and cannot host anything all by itself. Don't be confused by the fact that passenger can run as an Apache or NGINX plugin. That's just an implementation detail. Passenger can run as a stand-alone application server, too.
The pattern is this: Application Server starts up, accepts connections at some port, like 12345. NGINX or Apache or whatever Web Server starts up, accepts connections at 80 or 443 or both. A "reverse proxy" is configured in the Web Server configuration, and when a request comes in that matches it, the request is proxied to the Application Server. The response from the Application Server is then proxied back through the Web Server to the requesting browser.
1. Figure out which Application Server you want to use to run your Rails application, and configure it to start at system start, and to restart when you need it to (every time you update your Rails code).
2. Google "how do I configure a reverse proxy in NGINX". Do what you see in the results.
That's how you set this up.
Walter
> To unsubscribe from this group and stop receiving emails from it, send an email to
rubyonrails-ta...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/7694b56e-5ae7-49a5-8068-0999acf7da64%40googlegroups.com.