Nginx 未知的 limit_req_zone

Nginx 未知的 limit_req_zone

由于标题中提到的错误,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

这是在使用模板创建相关 VM(www.myhashimotosthyroiditis.com)之后立即进行的我在这里找到这据称是“为懒人提供的开箱即用”模板。

我对 Nginx 还很陌生,无法通过谷歌或在这里搜索找到任何有用的信息,所以如果这是愚蠢的产物,我深表歉意。

以下是整个 VM 文件:

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;
}

答案1

听起来你还没有定义limit_req_zonehttp{}块中。

相关内容