In meiner Datei /etc/nginx/nginx.conf habe ich config. wie:-
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;
}
Nun, ich möchte nicht die Standard-Datei nginx.conf verschmutzen, daher behielt ich die Konfiguration in /etc/nginx/conf.d/default.conf wie folgt bei:
worker_processes 2;
events {
worker_connections 2048;
}
Meine Frage ist, in obigem Szenario wird NginxKonfiguration für worker_processes und worker_connections aus der Datei default.conf oder der Datei nginx.conf überschreiben oder auswählen? Außerdem würde ich gerne wissen, wie nginx Konfigurationsdateien kurz verarbeitet.
Antworten:
1 für die Antwort № 1Ich bin sicher, dass die Konfiguration in default.conf zuerst von nginx ausgewählt wird. Aus diesem Grund wird in der Zeile "include /etc/nginx/conf.d/*.conf;" alle Standardwerte überschrieben und Funktionen hinzugefügt.