Forum: NGINX limit_conn_zone Nginx Unknow error

D207dfc04524519f516e3f32df986d2e?d=identicon&s=25 Raul Hugo (Guest)
on 2014-04-07 16:52
(Received via mailing list)
What am I doing wrong here?

    http {
             limit_conn_zone $binary_remote_addr zone=one:63m;

            server {
                 location /downloads/ {
                  limit_conn one 10;}

[root@batman1 ~]# service nginx configtest
nginx: [emerg] the size 66060288 of shared memory zone "one" conflicts
with already declared size 0 in /etc/nginx/nginx.conf:60
nginx: configuration file /etc/nginx/nginx.conf test failed


I read the nginx manual online, and it look well. I hope that someone
have
a tip.

--
Un abrazo!


*Ral Hugo <http://twitter.com/raulhugo>*


*Miembro Asociadohttp://apesol.org.pe <http://apesol.org.pe/>SysAdmin
Cel.
#961-710-096  Linux Registered User #482081 - http://counter.li.org/
<http://counter.li.org/>P Antes de imprimir este e-mail piense bien si
es
necesario hacerlo*
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2014-04-07 18:02
(Received via mailing list)
Hello!

On Mon, Apr 07, 2014 at 09:51:31AM -0500, Raul Hugo wrote:

> nginx: [emerg] the size 66060288 of shared memory zone "one" conflicts
> with already declared size 0 in /etc/nginx/nginx.conf:60
> nginx: configuration file /etc/nginx/nginx.conf test failed
>
>
> I read the nginx manual online, and it look well. I hope that someone have
> a tip.

From the message it looks like you've tried to use limit_conn
before limit_conn_zone is defined (probably indirectly by using
the "include" directive), i.e. wrote something like

    limit_conn one 10;
    limit_conn_zone $binary_remote_addr zone=one:63m;

--
Maxim Dounin
http://nginx.org/
D207dfc04524519f516e3f32df986d2e?d=identicon&s=25 Raul Hugo (Guest)
on 2014-04-07 18:18
(Received via mailing list)
Hey Maxim, thx for your answer.

On my /etc/nginx/nginx.conf I put this:

limit_conn_zone $binary_remote_addr zone=one:63m;

And on my .conf of my project located on
/etc/nginx/vhost.d/myproject.conf

I put this :

on the server configuration:

 location / {

         limit_conn one 10;

}

Nginx read the include first, if this line it before the limit_conn_zone
directive?




2014-04-07 11:02 GMT-05:00 Maxim Dounin <mdounin@mdounin.ru>:

> >                  location /downloads/ {
> > a tip.
> http://nginx.org/
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--
Un abrazo!


*Ral Hugo <http://twitter.com/raulhugo>*


*Miembro Asociadohttp://apesol.org.pe <http://apesol.org.pe/>SysAdmin
Cel.
#961-710-096  Linux Registered User #482081 - http://counter.li.org/
<http://counter.li.org/>P Antes de imprimir este e-mail piense bien si
es
necesario hacerlo*
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2014-04-07 19:14
(Received via mailing list)
Hello!

On Mon, Apr 07, 2014 at 11:17:40AM -0500, Raul Hugo wrote:

> on the server configuration:
>
>  location / {
>
>          limit_conn one 10;
>
> }
>
> Nginx read the include first, if this line it before the limit_conn_zone
> directive?

Include will, literally, include contents of its argument.  That
is, something like

    include /path/to/file/with/limit_conn;
    limit_conn_zone ...

is essentially equivalent to

    <contents of /path/to/file/with/limit_conn>
    limit_conn_zone ...

You have to define limit_conn_zone before it's used, and hence
before the include of the server configuration.

> > >
> > > I read the nginx manual online, and it look well. I hope that someone
> > --
>
> necesario hacerlo*
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


--
Maxim Dounin
http://nginx.org/
D207dfc04524519f516e3f32df986d2e?d=identicon&s=25 Raul Hugo (Guest)
on 2014-04-07 19:17
(Received via mailing list)
Thx!

I resolve my miss configuration.

Only changing of position my include to the final of file.


2014-04-07 12:13 GMT-05:00 Maxim Dounin <mdounin@mdounin.ru>:

> > And on my .conf of my project located on
> > }
> is essentially equivalent to
> > >
> > > >
> > >
> > >
> >
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--
Un abrazo!


*Ral Hugo <http://twitter.com/raulhugo>*


*Miembro Asociadohttp://apesol.org.pe <http://apesol.org.pe/>SysAdmin
Cel.
#961-710-096  Linux Registered User #482081 - http://counter.li.org/
<http://counter.li.org/>P Antes de imprimir este e-mail piense bien si
es
necesario hacerlo*
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.