Como fazer uma modificação ter efeito sem reiniciar o nginx?

65

O Apache tem uma opção graceful que pode verificar a modificação em http.conf sem reiniciar o Apache. E o nginx?

    
por vps 01.02.2010 / 10:50

5 respostas

69

O nginx suporta os seguintes sinais:

TERM, INT - Quick shutdown
QUIT - Graceful shutdown
HUP - Configuration reload: Start the new worker processes with a new configuration, Gracefully shutdown the old worker processes
USR1 - Reopen the log files
USR2 - Upgrade Executable on the fly
WINCH - Gracefully shutdown the worker processes

HUP é o que você está procurando, então sudo kill -HUP pid (nginx pid)

fonte: link

    
por 01.02.2010 / 11:01
80

Use o recarregamento de nginx -s

    
por 02.02.2010 / 14:44
19

Normalmente, o script init do nginx tem reload action, por exemplo:

  • Linux /etc/init.d/nginx reload
  • FreeBSD /usr/local/etc/rc.d/nginx reload
por 01.02.2010 / 17:25
2

service nginx reload ?

P.S. Não funciona no Windows.

    
por 07.02.2015 / 09:30
0

Eu escrevi sobre como reiniciar o nginx com tempo de inatividade zero há algum tempo. Isso pode ser útil para você.

link

    
por 03.02.2010 / 21:01