由于标题中提到的错误,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)后立即使用模板I found here,该模板被认为是“开箱即用的懒人”模板.

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

听起来你还没有在http {}块中定义limit_req_zone.

dawei

【声明】:唐山站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。