nginxÖØÆôÏÂÁîreload
nginx ÖØмÓÔØÏÂÁî reload ÓÃÓÚÖØмÓÔØÉèÖ㬶ø²»ÖÐÖ¹ÅþÁ¬¡£ÆäÀú³Ì°üÀ¨ÎüÊÕÏÂÁî¡¢¹Ø±Õ¾É worker¡¢ÖØмÓÔØÉèÖá¢Æô¶¯Ð worker¡£ºÎʱʹÓôËÏÂÁ¸üÐÂÉèÖÃÎļþ¡¢ÐÞ¸ÄÄ£¿éÉèÖᢸüРnginx ×Ô¼º¡£
Nginx ÖØмÓÔØÏÂÁreload
Nginx ÖØмÓÔØÏÂÁî reload ÓÃÓÚÖØмÓÔØ Nginx ÉèÖÃÎļþ£¬¶ø²»ÖÐÖ¹ÕýÔÚ¾ÙÐеÄÅþÁ¬¡£ÕâÒâζ×Å Nginx ½«ÖØжÁÈ¡ÉèÖÃÎļþÖеÄÉèÖ㬲¢ÏìÓ¦µØ¸üÐÂÆäÉèÖ㬵«²»»áÖÕÖ¹»òÖØÆôÕýÔÚÔËÐÐµÄ Nginx Àú³Ì¡£
ʹÓÃÒªÁ죺
ÖØмÓÔØ Nginx µÄÏÂÁîÓï·¨ÈçÏ£º
nginx -s reload
µÇ¼ºó¸´ÖÆ
Ö´ÐÐÀú³Ì£º
- ÎüÊÕÖØмÓÔØÏÂÁNginx Àú³ÌÊÕµ½ÖØмÓÔØÏÂÁîºó£¬»á½¨ÉèÒ»¸öÐ嵀 worker Àú³Ì¡£
- ¹Ø±Õ¾É worker£ºÐ嵀 worker Àú³ÌÆô¶¯ºó£¬Nginx »áÏòËùÓÐ¾É worker Àú³Ì·¢ËÍ SIGUSR2 Ðźţ¬ÒªÇóËüÃÇÓÅÑŵعرա£
- ÖØмÓÔØÉèÖãº¾É worker Àú³Ì¹Ø±Õºó£¬Nginx Àú³Ì»áÖØжÁÈ¡ÉèÖÃÎļþ£¬²¢¸üÐÂÆäÉèÖá£
- Æô¶¯Ð worker£ºÖØмÓÔØÉèÖÃÍê³Éºó£¬Nginx Àú³Ì»áÆô¶¯Ð嵀 worker Àú³ÌÒÔÌæ»»¹Ø±ÕµÄ¾É worker¡£
ÐèҪעÖصļ¸µã£º
- ÖØмÓÔØÏÂÁî²»»áÖÐÖ¹ÕýÔÚ¾ÙÐеÄÅþÁ¬£¬Òò´Ë²»»áÓ°ÏìÍøÕ¾»òÓ¦ÓóÌÐòµÄ¿ÉÓÃÐÔ¡£
- ÖØмÓÔØÏÂÁîÖ»ÄÜÓ¦ÓÃÓÚÉèÖøü¸Ä£¬¶ø²»¿ÉÓ¦ÓÃÓÚ´úÂë¸ü¸Ä¡£
- ÈôÊÇÉèÖÃÖб£´æ¹ýʧ£¬ÖØмÓÔØÏÂÁî»áµ¼Ö Nginx Àú³ÌÖÕÖ¹¡£
- ÖØмÓÔØÏÂÁîÊÊÓÃÓÚËùÓÐ worker Àú³Ì£¬Òò´ËÈôÊÇij¸ö worker Àú³ÌÍ߽⣬ÖØмÓÔØÏÂÁ¶ÔÆä¾ÙÐÐÖØÆô¡£
ºÎʱʹÓÃÖØмÓÔØÏÂÁ
ÖØмÓÔØÏÂÁîͨ³£ÔÚÒÔÏÂÇéÐÎÏÂʹÓãº
- ¸üРNginx ÉèÖÃÎļþ£ºÀýÈ磬¸ü¸ÄÐéÄâÖ÷»úµÄÉèÖûòÌí¼ÓÐ嵀 location ¿é¡£
- ÐÞ¸Ä Nginx Ä£¿éÉèÖãºÀýÈ磬ÆôÓûò½ûÓÃÄ£¿é¡£
- ¸üРNginx ×Ô¼º£ºÔÚ Nginx ×°ÖûòÉý¼¶ºó¡£
ÒÔÉϾÍÊÇnginxÖØÆôÏÂÁîreloadµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡
ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£