# nginx: [emerg] invalid arguement (cookie)

## gencol

Hi,

I've emerged nginx with the "NGINX_MODULES_HTTP: sticky" flag but still when I try to use sticky cookies for load balancing

However nginx won't restart providing this error

```
 # /etc/init.d/nginx restart

 * Checking nginx' configuration ...

nginx: [emerg] invalid arguement (cookie) in /etc/nginx/nginx.conf:9

nginx: configuration file /etc/nginx/nginx.conf test failed
```

Here's the relevant part of nginx.conf

```
upstream php-fpm {

   server 127.0.0.1:9009 max_fails=2 fail_timeout=5s;

   server 127.0.0.1:9009 max_fails=2 fail_timeout=5s;

   server 127.0.0.1:9009 max_fails=2 fail_timeout=5s;

   sticky cookie srv_id expires=1h domain=.example.com path=/;

}
```

Mind I have different IPs but changed them all here.

Here's how nginx was emerged

```

[I] www-servers/nginx

     Available versions:

     (0)    1.10.1 ~1.10.1-r1

     (mainline) ~1.11.2

       {aio debug +http +http-cache +http2 ipv6 libatomic libressl luajit +pcre pcre-jit rtmp selinux ssl threads vim-syntax NGINX_MODULES_HTTP="+access addition ajp +auth_basic auth_ldap auth_pam auth_request +autoindex +browser cache_purge +charset dav dav_ext degradation echo +empty_gif fancyindex +fastcgi flv +geo geoip gunzip +gzip gzip_static headers_more image_filter +limit_conn +limit_req lua +map memc +memcached metrics mogilefs mp4 naxsi perl +proxy push_stream random_index realip +referer +rewrite +scgi secure_link security slice slowfs_cache spdy +split_clients +ssi sticky stub_status sub upload_progress upstream_check +upstream_ip_hash +userid +uwsgi xslt" NGINX_MODULES_MAIL="imap pop3 smtp" NGINX_MODULES_STREAM="access limit_conn upstream" USERLAND="GNU"}

     Installed versions:  1.10.1(23:05:33 08/13/16)(http http-cache http2 pcre ssl -aio -debug -ipv6 -libatomic -libressl -luajit -pcre-jit -rtmp -selinux -threads -vim-syntax NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_conn limit_req map memcached proxy referer rewrite scgi split_clients ssi sticky upstream_ip_hash userid uwsgi -addition -ajp -auth_ldap -auth_pam -auth_request -cache_purge -dav -dav_ext -degradation -echo -fancyindex -flv -geoip -gunzip -gzip_static -headers_more -image_filter -lua -memc -metrics -mogilefs -mp4 -naxsi -perl -push_stream -random_index -realip -secure_link -security -slice -slowfs_cache -spdy -stub_status -sub -upload_progress -upstream_check -xslt" NGINX_MODULES_MAIL="-imap -pop3 -smtp" NGINX_MODULES_STREAM="limit_conn upstream -access" USERLAND="GNU")

     Homepage:            http://nginx.org

     Description:         Robust, small and high performance http and reverse proxy server

```

Any ideas of what might still be missing? Thanks  :Smile: 

----------

## guitou

Hello.

Looks like session persistence is part of nginx PLUS, not nginx.

++

Gi)

----------

## gencol

The note in their documentation is only about the "sticky learn" and not other directives.

If that's the case, what is the flag "NGINX_MODULES_HTTP: sticky" used for?

----------

## guitou

Well, btw I must be wrong.

Looking at https://www.nginx.com/products/feature-matrix/, I saw "session persistence" available only for nginx plus, thus my first reply.

Then looking at http://nginx.org/en/docs/http/ngx_http_upstream_module.html#sticky, I think you got the right answer:

 *Quote:*   

> This directive appeared in version 1.5.7. 

 

++

Gi)

----------

## gordonb3

The hint could be in the fact that it complains about "cookie", not "sticky".

The page you refer to is about a module named "ngx_http_upstream_module", yet you added a USE flag that refers to a module named "nginx-sticky-module-ng" that is taken from an external source https://bitbucket.org/nginx-goodies/ You'll find the correct syntax for that module there as well.

----------

