conf
file
By default, the configuration file is named nginx.conf
and placed in the directory /usr/local/nginx/conf
, /etc/nginx
, or /usr/local/etc/nginx
.
nginx signal
nginx -s signal Where signal may be one of the following:
- stop — fast shutdown
- quit — graceful shutdown
- reload — reloading the configuration file
- reopen — reopening the log files
lookup
A signal may also be sent to nginx processes with the help of Unix tools such as the kill utility.
For example, if the master process ID is 1628, to send the QUIT signal resulting in nginx’s graceful shutdown, execute:
kill -s QUIT 1628
For getting the list of all running nginx processes, the ps utility may be used, for example, in the following way:
ps -ax | grep nginx
Configuration File’s Structure
location
- 路径配置区别
- root
- 基准路径,一定是去访问$uri子路径下找资源
- alias
- 路径一定要/结尾
- 真实地址,和访问$uri无关
- 优先级
- =精准匹配
- 最大陪陪路径
- 譬如访问/a/b/c,则location匹配/a/ba高于location /a
- root
Reference
- NGIX-official-website(static-content): docs.nginx.com/nginx/admin…