title: nginx: [emerg] the size 10485760 of shared memory zone "limit" conflicts with already declared size 5242880
body: <p>My server：centos7，openresty，php7</p>
  
  <p>I followed this tutorial： <a href="https://segmentfault.com/a/1190000011299586" rel="nofollow noreferrer">https://segmentfault.com/a/1190000011299586</a></p>
  
  <p>After I typed this command：</p>
  
  <p><code>/usr/local/openresty/nginx/sbin/nginx -t</code></p>
  
  <p>error showed up：</p>
  
  <blockquote>
    <p>nginx: [emerg] the size 10485760 of shared memory zone "limit" conflicts with already declared size 52428800 in /usr/local/openresty/nginx/conf/nginx.conf:38 nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed</p>
  </blockquote>
  
  <p>How to  fix this issue? Where can I modify? </p>
  
  <p>I executed these commands：</p>
  
  <p><code>vim /usr/local/openresty/nginx/conf/nginx.conf</code></p>
  
  <p><code>/usr/local/openresty/nginx/sbin/nginx -t</code></p>
  
  <p>Paste my  nginx.conf：</p>
  
  <pre><code>user www; worker_processes 1;
  
  #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info;
  
  #pid logs/nginx.pid;
  
  events { worker_connections 1024; }
  
  http { include mime.types; default_type application/octet-stream;
  
  #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  #                  '$status $body_bytes_sent "$http_referer" '
  #                  '"$http_user_agent" "$http_x_forwarded_for"';
  
  #access_log  logs/access.log  main;
  
  sendfile        on;
  #tcp_nopush     on;
  #WAF
  
  lua_shared_dict limit 50m;  #防 cc 使用字典，大小 50M
  lua_shared_dict guard_dict 100m;
  lua_shared_dict dict_captcha 70m;
  lua_max_running_timers 1;
  lua_package_path "/usr/local/openresty/nginx/conf/waf/?.lua";
  init_by_lua_file "/usr/local/openresty/nginx/conf/waf/init.lua";
  access_by_lua_file "/usr/local/openresty/nginx/conf/waf/access.lua";
  lua_shared_dict limit 10m;
  
  #keepalive_timeout  0;
  keepalive_timeout  65;
  
  #gzip  on;
  
  server {
      listen       80;
      server_name  localhost;
  
      #charset koi8-r;
  
      #access_log  logs/host.access.log  main;
  
      location / {
          root   html;
          index  index.html index.htm index.php;
      }
  
      #error_page  404              /404.html;
  
      # redirect server error pages to the static page /50x.html
      #
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
  
      # proxy the PHP scripts to Apache listening on 127.0.0.1:80
      #
      #location ~ \.php$ {
      #    proxy_pass   http://127.0.0.1;
      #}
  
      # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
      #
      #location ~ \.php$ {
      #    root           html;
       #    fastcgi_pass   127.0.0.1:9000;
      #    fastcgi_index  index.php;
      #    fastcgi_param  SCRIPT_FILENAME  /document_root$fastcgi_script_name;
      #    include        fastcgi_params;
      #}
  
      # deny access to .htaccess files, if Apache's document root
      # concurs with nginx's one
      #
      #location ~ /\.ht {
      #    deny  all;
      #}
  }
  
  
  # another virtual host using mix of IP-, name-, and port-based configuration
  #
  #server {
  #    listen       8000;
  #    listen       somename:8080;
  #    server_name  somename  alias  another.alias;
  
  #    location / {
  #        root   html;
  #        index  index.html index.htm;
  #    }
  #}
  
  
  # HTTPS server
  #
  #server {
  #    listen       443 ssl;
  #    server_name  localhost;
  
  #    ssl_certificate      cert.pem;
  #    ssl_certificate_key  cert.key;
  </code></pre>