In der X-WAF-Bereitstellung müssen Sie eine neue Nginx-Konfigurationsdatei erstellen. Beim Testen der Nginx-Konfiguration wird jedoch ein Fehler gefunden und Nginx kann nicht gestartet werden.
Ich verweise auf http://blog.51cto.com/14071176/2318054 , Ich habe es Schritt für Schritt gemäß der Konfiguration im Artikel gemacht, aber ich hatte ein Problem.
[email protected]:~# /usr/local/openresty/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/openresty/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] no "events" section in configuration
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
[email protected]:~# /usr/local/openresty/nginx/sbin/nginx
nginx: [emerg] no "events" section in configuration
Unter normalen Umständen hat die Ausführung von/usr/local/openresty/nginx/sbin/nginx -t zwei Erfolge, aber meiner ist ein Erfolg und ein Misserfolg.
Einfach hinzufügen events { }
über http {
Linie.
// Dieser Kommentar hat bei mir funktioniert.
Löse für mich:
events {}
http {
server {
# Your code here
}
}