NGINX 基礎入門(Windows 版)

NGINX 基礎入門(Windows 版)

當我們啟用 nginx.exe 之後,需要透過 -s signal 來與 nginx.exe 溝通。

nginx.exe -s signal

signal 值可以是:

  • stop: fast shutdown
  • quit: graceful shutdown
  • reload:reloading the configuration file
  • reopen:reopening the log files

nginx.conf 組態

nginx.conf 是整個 NGINX 核心,管理者透過 nginx.conf 來調整 NGINX 運作行為。

在測試階段,最常用的是 nginx.exe -s reload 來重新載入 nginx.conf。

nginx.conf 最基本組成語法:

<section> {
    <directive> <parameters>;
}

注意,每一行指令都需要由分號(;)結束。例如:events 設置:

events {
    worker_connections  1024;
}