由于标题中提到的错误,Nginx目前不会启动。 这是我得到的实际错误:
$ sudo /etc/init.d/nginx restart Restarting nginx: nginx: [emerg] unknown limit_req_zone "one" in /etc/nginx/sites-enabled/www.myhashimotosthyroiditis.com:15 nginx: configuration file /etc/nginx/nginx.conf test failed
这就是在创buildVM(www.myhashimotosthyroiditis.com)后立即使用我在这里发现的模板,据说这是一种“开箱即用”的模板。
我对Nginx非常陌生,我找不到任何有用的信息,通过谷歌或在这里search,所以我请原谅,如果这是愚蠢的产品。
这是整个虚拟机文件:
server { listen 80; server_name myhashimotosthyroiditis.com www.myhashimotosthyroiditis.com; root /var/www/myhashimotosthyroiditis; access_log /var/log/nginx/myhashimotosthyroiditis.access.log; error_log /var/log/nginx/myhashimotosthyroiditis.error.log; location / { try_files $uri $uri/ /index.php; } location /search { limit_req zone=one burst=3 nodelay; rewrite ^ /index.php; } fastcgi_intercept_errors off; location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } include php.conf; # You may want to remove the robots line from drop to use a virtual robots.txt # or create a drop_wp.conf tailored to the needs of the wordpress configuration include drop.conf; }
这听起来像你没有在http{}块中定义limit_req_zone 。