简体   繁体   中英

Rails & Nginx - How to get $rails s to use Nginx instead of WEBrick by default? or

I want to set up rails to use Nginx instead of WEBrick by default when I use $rails server

From my googling, it seems that this could possibly be done via. Rack. If so, where is the directory for the Rack file? Or maybe it can be done with Nginx config files?

Could anyone please help me with this setup? I am using Rails 4.2, Ruby 2.1.5, Nginx 1.4.6, Ubuntu 14.04

or.... Is there a terminal command to start the app with nginx? ie. instead of $rails s, something else that will load the web app on localhost:3000

This other question shows how to change the default webserver:
How to change the default rails server in Rails 3?

You could adapt the instructions to use Nginx, as it is still valid for Rails 4.*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM