nginxÊÇʲôÎļþ
nginxµÄÉèÖÃÎļþλÓÚ/etc/nginx/nginx.conf»ò/usr/local/etc/nginx/nginx.conf£¬°üÀ¨È«¾ÖÉèÖÃÖ¸ÁЧÀÍÆ÷¿éÖ¸ÁλÖÿéÖ¸Áͨ¹ýÐ޸ĴËÎļþ¿ÉÉèÖÃnginx¡£
nginxÊÇʲôÎļþ£¿
nginxÊÇÒ»ÖÖ¿ªÔ´µÄ¡¢¸ßÐÔÄܵÄWebЧÀÍÆ÷£¬³£ÓÃÓÚ´¦Öóͷ£¸ß²¢·¢Á÷Á¿¡£ÆäÉèÖÃÎļþλÓÚ/etc/nginx/nginx.conf»ò/usr/local/etc/nginx/nginx.conf£¨ÏêϸλÖÃÒòϵͳ²î±ð¶øÒ죩¡£
nginx.confÉèÖÃÎļþ
nginx.confÉèÖÃÎļþ°üÀ¨ÖÖÖÖÖ¸ÁÓÃÓÚ½ç˵nginxµÄÉèÖá£ÆäÖÐ×îÖ÷ÒªµÄ²¿·Ö°üÀ¨£º
- È«¾ÖÉèÖÃÖ¸ÁÉèÖÃnginxµÄÈ«¾Ö²ÎÊý£¬ÈçÈÕÖ¾¼¶±ð¡¢¹ýʧҳÃæºÍ¼àÌý¶Ë¿Ú¡£
- ЧÀÍÆ÷¿éÖ¸Á½ç˵Ҫ¼àÌýµÄЧÀÍÆ÷ºÍÐéÄâÖ÷»ú£¬²¢ÉèÖÃÆäÌض¨ÉèÖá£
- λÖÿéÖ¸ÁÓÃÓÚ½ç˵Ìض¨URL·¾¶µÄ´¦Öóͷ£·½·¨£¬ÈçÎļþЧÀÍ¡¢Öض¨ÏòºÍ·´ÏòÊðÀí¡£
ÆäËûÉèÖÃÎļþ
³ýÁËnginx.confÖ÷ÉèÖÃÎļþÍ⣬nginx»¹¿ÉÒÔʹÓÃÆäËûÉèÖÃÎļþÀ´À©Õ¹Æ书Ч£º
- mime.types£º½ç˵ÎļþÀàÐ͵ÄMIMEÀàÐÍ¡£
- fastcgi.conf£ºÉèÖÃFastCGIÀú³ÌµÄ²ÎÊý¡£
- proxy.conf£ºÉèÖ÷´ÏòÊðÀí²ÎÊý¡£
- ssl.conf£ºÉèÖÃSSL/TLSÖ¤ÊéºÍÃÜÂë¡£
nginxÉèÖÃÎļþµÄ½á¹¹
nginxÉèÖÃÎļþ½ÓÄÉ·Ö²ã½á¹¹£¬ÓÉÒÔϲ¿·Ö×é³É£º
- main£º°üÀ¨È«¾ÖÉèÖÃÖ¸Áî¡£
- events£ºÖ¸¶¨ÊÂÎñ´¦Öóͷ£²ÎÊý¡£
- http£º°üÀ¨HTTPЧÀÍÆ÷µÄÖ¸Áî¡£
- server£º½ç˵ЧÀÍÆ÷¿é¡£
- location£º½ç˵λÖÿ顣
ÐÞ¸ÄnginxÉèÖÃÎļþ
ÒªÐÞ¸ÄnginxÉèÖÃÎļþ£¬ÇëʹÓÃÎı¾±à¼Æ÷£¨Èçvi»ònano£©·¿ªËü¡£×ö³ö¸ü¸Äºó£¬ÖØмÓÔØnginxÉèÖÃÒÔʹ¸ü¸ÄÉúЧ£º
- Linux/MacOS£ºsudo nginx -s reload
- Windows£ºnginx.exe -s reload
ÒÔÉϾÍÊÇnginxÊÇʲôÎļþµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡