小编Tap*_*ash的帖子

NGINX 缓存错误:与 /etc/nginx/nginx.conf 中已声明的大小 0 冲突

我当前用于 drupal 配置的 nginx 出现以下错误。不知何故,我无法启用 nginx 缓存。尝试了不同的配置,但加班我得到了同样的错误。有人可以帮忙吗?

nginx: [emerg] the size 5242880 of shared memory zone "MYAPP" conflicts with already declared size 0 in /etc/nginx/nginx.conf:51
nginx: configuration file /etc/nginx/nginx.conf test failed
Run Code Online (Sandbox Code Playgroud)

我的 nginx.conf

user    nginx;
worker_processes    auto;
http {  include /etc/nginx/conf.d/*.conf;
include /etc/nginx/mime.types;
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=MYAPP:5M max_size=256M inactive=2h;
fastcgi_cache_key “$scheme$request_method$host$request_uri”;
add_header X-Cache $upstream_cache_status;

## Set a cache_uid variable for authenticated users.
map $http_cookie $cache_uid {
    default nil; # hommage to Lisp :)
    ~SESS[[:alnum:]]+=(?<session_id>[[:alnum:]]+) $session_id;
}
map $request_method $no_cache { …
Run Code Online (Sandbox Code Playgroud)

nginx cache drupal

4
推荐指数
1
解决办法
4441
查看次数

标签 统计

cache ×1

drupal ×1

nginx ×1