Home > Operation and Maintenance > Nginx > What is the meaning of nginx.conf global configuration

What is the meaning of nginx.conf global configuration

WBOY
Release: 2023-05-21 22:43:06
forward
1488 people have browsed it

user nobody;

定义运行nginx服务的用户,还可以加上组,如 user nobody nobody;
Copy after login

worker_processes 1;

定义nginx子进程数量,即提供服务的进程数量,该数值建议和服务cpu核数保持一致。
除了可以定义数字外,还可以定义为auto,表示让系统自动调整。
Copy after login

error_log logs/error.log;

定义错误日志的路径,可以是相对路径(相对prefix路径的),也可以是绝对路径。
该配置可以在此处定义,也可以定义到http、server、location里
Copy after login
error_log logs/error.log notice;
定义错误日志路径以及日志级别.
错误日志级别:常见的错误日志级别有[debug|info|notice|warn|error|crit|alert|emerg],级别越高记录的信息越少。
如果不定义默认是error
Copy after login

pid logs/nginx.pid;

定义nginx进程pid文件所在路径,可以是相对路径,也可以是绝对路径。
Copy after login

worker_rlimit_nofile 100000;

定义nginx最多打开文件数限制。如果没设置的话,这个值为操作系统(ulimit -n)的限制保持一致。
把这个值设高,nginx就不会有“too many open files”问题了。
Copy after login

The above is the detailed content of What is the meaning of nginx.conf global configuration. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template