【发布时间】:2016-11-17 04:11:56
【问题描述】:
在我的 /etc/nginx/nginx.conf 文件中我有配置。如:-
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}
现在,我不想污染上面默认的 nginx.conf 文件,所以我在 /etc/nginx/conf.d/default.conf 中保留了配置:-
worker_processes 2;
events {
worker_connections 2048;
}
我的问题是,在上述情况下,nginx 会覆盖或从 default.conf 文件或 nginx.conf 文件中选择 worker_processes 和 worker_connections 的配置吗?另外,我想知道简而言之nginx是如何处理配置文件的?
【问题讨论】:
标签: nginx