Nginx的配置文件一般位于Nginx安装目录的conf目录下
(nginx.conf文件),整个配置文件是以块的形式组织的。每
个块一般以一个大括号“{}”来表示,块可以分为几个层次,
整个配置文件中main指令位于最高层,在main层下面可以
有Events,HTTP等层级,而在HTTP层中又包含server
层,server块中又可分为location层,并且一个server块中
可以包含多个location块。
![]()
1.Nginx全局配置
user nobody nobody;
worker_processes 8;
error_log logs/error.log notice;
pid logs/nginx.pid;
worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections 65535;
}
http
{
error_log logs/http_error.log
server
{
server_name one;
access_log logs/one.access;
error_log logs/one.error.log;
}
server
{
server_name two;
access_log logs/two.access;
error_log logs/two.error.log;
}
}
可以通过kill命令发送信号给该ID号。例如平滑重启:shell>kill -HUP `cat /var/log/nginx.pid`
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28624388/viewspace-763031/ ,如需转载,请注明出处,否则将追究法律责任。