简体   繁体   中英

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

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> .

Passenger is built to auto-run at all times.

As a workaround, you can stop the webserver entirely, or stop serving the particular app that you don't want to be served by removing the virtual host entry for it.

You could also uninstall passenger if you're really desperate

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