Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop rails nginx-passenger application?

I use the passenger spawned by nginx. There are many other rails applications on the server that uses passenger (each has own virtual host in nginx).

I can restart the Rails/Nginx/Passenger application like this:

touch tmp/restart.txt

How I can stop it?

This doesn't work:

touch tmp/stop.txt
touch tmp/shutdown.txt
like image 219
freemanoid Avatar asked Mar 21 '23 23:03

freemanoid


1 Answers

Method 1

Remove your app's virtual host entry and restart Nginx. Phusion Passenger will no longer serve it.

Method 2

In case you want to keep your app's virtual host entry, but not actually run the app.

Set the following option and restart Nginx:

passenger_min_instances 0;

Phusion Passenger will now shut down your app if it hasn't seen traffic for a while (~10 minutes). It'll be started again if traffic comes in for that app.

With passenger_min_instances 0, you can also kill the application processes manually. Look up the PIDs with passenger-status, then run kill <PID>.

like image 167
Hongli Avatar answered Apr 01 '23 13:04

Hongli