How do i make nginx and passenger restart automati

2019-04-11 00:50发布

I currently have a rails app deployed on a virtual private server.

I use Capistrano, Nginx and passenger to run my rails app on the server.

For some reason I can never get the updated code to display on the site after i have done a cap deploy:update.

The deploy happens fine and the code is even seen on the live server via Vim but if I navigate to the live site it won't display.

My current workaround is rebooting the server, starting nginx and passenger after the server boots back up.

my concern is if someone is logged on to the site when i deploy and restart, it will knock them off the site.

Does anyone have any ideas

2条回答
我想做一个坏孩纸
2楼-- · 2019-04-11 01:20

If you run touch tmp/restart.txt from your rails root directory, passenger will restart the app. You shouldn't have to restart nginx. After the timestamp of the restart.txt file changes, Passenger will restart for the next request. If your app takes a while to boot, you may want to force this by making a request immediately after touching the file.

You don't need to worry about kicking someone off the site, it won't restart the server if there is a request in process.

查看更多
甜甜的少女心
3楼-- · 2019-04-11 01:29

If you are still facing the problem you can use Monit gem, in capstraino it works really well.

查看更多
登录 后发表回答