Nginx 延时无效参数

Nginx 延时无效参数

我有这个/etc/nginx/conf.d/gessin.conf

server {
        listen       80 ;
        listen       [::]:80 ;
        server_name  admin.example.com;
        root /home/developer/www/admin;
        client_body_timeout 5s;
        client_header_timeout 5s;
        index index.php index.html index.htm;
    location / {
      try_files $uri $uri/ /index.php?$args;
    }
    location ~ \.php$ {
            limit_req zone=http burst=20 delay=8;
            limit_conn addr 10;
            try_files $uri =404;
            fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
    }
}

nginx抱怨延迟不是一个正确的参数:

[root@dmz-1 developer]# nginx -c /etc/nginx/nginx.conf -t
nginx: [emerg] invalid parameter "delay=8" in /etc/nginx/conf.d/gessin.conf:14
nginx: configuration file /etc/nginx/nginx.conf test failed

答案1

根据 Richard Smith 的评论,版本错误。该delay选项仅适用于 nginx > 1.15.7

yum updtate nginx

相关内容