shared memory zone "media" conflicts with already declared size 0

Ruslan Ermilov ru at
Fri Feb 8 18:45:16 UTC 2013

On Fri, Feb 08, 2013 at 10:01:30AM -0500, atipico wrote:
> I am using nginx version: nginx/1.2.6 and facing a similar error:
> Starting nginx: nginx: the configuration file /etc/nginx/nginx.conf syntax
> is ok
> nginx: [emerg] zero size shared memory zone "limit_per_ip"
> nginx: configuration file /etc/nginx/nginx.conf test failed
> invoke-rc.d: initscript nginx, action "start" failed.
> Here's my nginx.conf file:
> http {
> 	#limit_zone limit_per_ip $binary_remote_addr 16m;

The "limit_per_ip" zone, including its size of 16 megabytes,
was originally configured here.

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

At least one of the included files refers to this zone through
the "limit_conn" directive.  The diagnostics is rather limited
in this case, but the message tells you that the size of the
shared memory zone "limit_per_ip" is unknown (because the
corresponding directive is commented out).

JFYI, in modern versions of nginx the "limit_conn_zone" directive
should be used instead.  See for

More information about the nginx mailing list