Ubuntu 16.04: nginx: [emergir] zona de memória compartilhada tamanho zero “one”

1

Eu quero fazer um projeto localmente. Quando tento usar php-fpm com essa linha fastcgi_pass unix:/run/php/php7.0-fpm.sock; , então nginx não é recarregado, sai com erro: nginx: [emerg] zero size shared memory zone "one" .

Como posso resolver este problema? Devo configurar nginx_uploadprogress_module ?

Meu arquivo de configuração:

server {

    listen 80;
    server_name demi-le.work;

    # DDoS protection - allow up to 20 r/s peaks
    limit_req zone=one burst=20;


    root /home/demi/projects/demi-le.work/web;
    #root /opt/sites/underconstruction;
    index index.htm index.html index.php app-ind.php;
    client_max_body_size 30m;
    charset utf-8;

    # Deliver static content
    location /public {

            # DDoS protection - allow up to 50 r/s peaks
            #limit_req zone=one burst=50;

        root /home/demi/projects/demi-le.work;
        access_log off;
        expires 300d;
    }

    # Security
    location ~* \/public\/images\/.*\.php$ {
        deny all;
    }

    # Deliver dynamic content
        location ~ (\/public\/scripts.*\.php)(.*)$ {
                include /etc/nginx/fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /home/demi/projects/demi-le.work/$fastcgi_script_name;
                fastcgi_param SCRIPT_NAME $1;
                fastcgi_param DOCUMENT_ROOT /home/demi/projects/demi-le.work; # this param required
                #fastcgi_keep_conn on;
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        }

    location ~ \.php$ {
            include /etc/nginx/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /home/demi/projects/demi-le.work/web$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT /home/demi/projects/demi-le.work/web; # this param required
        #fastcgi_keep_conn on;
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;     

    }

    location @php {
                include /etc/nginx/fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /home/demi/projects/demi-le.work/web/index.php;
                #fastcgi_keep_conn on;
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;     
        }

    location / {
        default_type text/html;
        root /home/demi/projects/demi-le.work/web;
        #root /opt/sites/underconstruction;
        if (!-e $request_filename) {
            return 404;
        }
        error_page      404 502 504 403 405 = @php;
    }

    # Redecalaring 502 error
    error_page 502 = /502.html;
    location = /502.html {
        root /home/demi/projects/demi-le.work/web;
    }  

    error_page 405 = @405;
    location = @405 {
        root /home/demi/projects/demi-le.work/web;
    }

}
    
por Dmitro 24.10.2016 / 11:37

1 resposta

1

Você está usando limit_req zone=zonename burst=20; , para fazer com que os limites funcionem eu preciso alterá-lo:

limit_req_zone $http_x_forwarded_for zone=zonename:20m rate=100r/s; # you missed line like this

server {
    .....
    location /public {
        limit_req zone=zonename nodelay;
        .....
    }
}

Claro, certifique-se de modificá-lo de acordo com os seus requisitos de limite.

    
por 25.10.2017 / 13:33

Tags