Nginx核心模块

error_log

语法:error_log file [ debug | info | notice | warn | error | crit ]
默认值:${prefix}/logs/error.log
指定Nginx服务(与FastCGI)错误日志文件位置。
每个字段的错误日志等级默认值:

1.main字段-error,2.HTTP字段-crit,3.server字段-crit

关闭日志功能:error_log /dev/null crit;

include

语法:include file | *
默认值:none
你可以包含一些其他的配置文件来完成你想要的功能。
0.4.4版本以后,include指令已经能够支持文件通配符:

include vhosts/*.conf

注意:文件的相对路径是根据nginx.conf所在目录决定

try_file

location / {
  try_files $uri $uri/ @drupal;
}

以项目根路径$document_root为根目录,判断$document_root/$uri,$document_root/$uri/是否存在,不存在则重定向至@drupal

worker_processes

理论最大连接数(max_clients) = worker_processes * worker_connections

反向代理最大连接数(max_clients) = worker_processes * worker_connections/4

posted @ 2018-01-18 10:44  Kerwing  阅读(298)  评论(0编辑  收藏  举报