配置 nginx 出错, nginx: [emerg] the size 10485760 of shared memory zone "limit" conflicts with already declared size 5242880 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kmdd33
V2EX    NGINX

配置 nginx 出错, nginx: [emerg] the size 10485760 of shared memory zone "limit" conflicts with already declared size 5242880

  •  
  •   kmdd33 2018-04-05 18:47:10 +08:00 4663 次点击
    这是一个创建于 2817 天前的主题,其中的信息可能已经有所发展或是发生改变。

    服务器:centos7,openresty,php7

    配置按照的教程: https://segmentfault.com/a/1190000011299586

    在执行命令:

    /usr/local/openresty/nginx/sbin/nginx -t

    出现了错误:

    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

    请问如何 fix 这个错误?在哪里修改?请教大佬们,谢谢。

    我执行的命令:

    vim /usr/local/openresty/nginx/conf/nginx.conf

    /usr/local/openresty/nginx/sbin/nginx -t

    贴出目前自己的 nginx.conf:

    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; 2,9 Top 
    PassPort
        1
    PassPort  
       2018-04-05 20:43:57 +08:00
    lua_shared_dict limit 50m; #防 cc 使用字典,大小 50M
    这个设置了
    下面还有一个 lua_shared_dict limit 10m;
    错误提示其实已经告诉你是为毛了
    defunct9
        2
    defunct9  
       2018-04-05 21:23:21 +08:00 via iPhone
    ......,本来想说台词来着,没机会了
    kmdd33
        3
    kmdd33  
    OP
       2018-04-05 21:43:02 +08:00
    @PassPort @defunct9 请问这 2 个地方应该改成多少呢?
    kmdd33
        4
    kmdd33  
    OP
       2018-04-06 12:53:19 +08:00
    @PassPort @defunct9 请问 2 位大佬都在吗?这 2 个地方具体应该改成多少呢?还是把这 2 个语句删除掉
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     5162 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 37ms UTC 07:25 PVG 15:25 LAX 23:25 JFK 02:25
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86