# Fastcgi\_cache\_path errors

**URL:** <https://www.ruby-forum.com/t/fastcgi-cache-path-errors/195075>\
**Category:** NGINX\
**Created:** [September 16, 2010, 1:28pm UTC](https://www.ruby-forum.com/t/fastcgi-cache-path-errors/195075 "2010-09-16T13:28:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![whiskybar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/50afbb/32.png) [@whiskybar](https://www.ruby-forum.com/u/whiskybar)\
**Post date:** [September 16, 2010, 1:28pm UTC](https://www.ruby-forum.com/t/fastcgi-cache-path-errors/195075/1 "2010-09-16T13:28:52Z")

</div>

Hello,

this is the first time I wanted to cache FastCGI responses from the  
upstream servers. I have set up everything like in the documentation  
examples but I got

```auto
Reloading nginx configuration: [emerg]: the size 10485760 of shared
memory zone "obrazek"
conflicts with already declared size 0 in /etc/nginx/nginx.conf:41
configuration file /etc/nginx/nginx.conf test failed
```

on nginx reload. It does not say where the first occurence of this  
memory zone is. I have grepped all my configs but this line 41 is the  
only occurrence. I’m using nginx 0.8.50. I noticed there were some  
directories /var/lib/nginx/fastcgi with the fastcgi\_cache two level  
structure already before I turned on this directive. I guessed there  
were created by the Ubuntu package. I redirected the fastcgi\_cache\_path  
to another location, yet to no avail.

```auto
user www-data;
worker_processes 4;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    include /etc/nginx/mime.types;
    log_format vcombined '$host $remote_addr - $remote_user
[$time_local] '
                            '"$request" $status $body_bytes_sent '
                            '"$http_referer" "$http_user_agent"';
    access_log /var/log/nginx/access.log vcombined;

    sendfile on;
    tcp_nopush on;

    keepalive_timeout 65;
    tcp_nodelay on;
    client_body_timeout 5;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

        fastcgi_cache_path /var/lib/nginx/fastcgi
                levels=1:2
                keys_zone=obrazek:10m
                inactive=5m;
}

upstream php {
        server unix:/var/run/php5-fpm.sock;
}

server {

        location / {
                root /var/www;
                index index.html index.php index.xhtml index.htm;
        }

        location /psat/obrazek.php {
                fastcgi_pass php;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME
/var/www$fastcgi_script_name;
                include fastcgi_params;

                fastcgi_cache obrazek;
                fastcgi_cache_valid any 10m;
                fastcgi_cache_use_stale error timeout invalid_header
http_500;
        }
}
```

fastcgi\_param:

```auto
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
```

Thank you  
Jiri

Posted at Nginx Forum:

> **[fastcgi\_cache\_path errors](https://forum.nginx.org/read.php?2,130917,130917#msg-130917)**
>
> Hello, this is the first time I wanted to cache FastCGI responses from the upstream servers. I have set up everything like in the documentation examples but I got \[code\] Reloading nginx configuration: \[emerg\]: the size 10485760 of shared memory zone...
