Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nginx: [emerg] invalid arguement (cookie)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gencol
n00b
n00b


Joined: 22 Nov 2012
Posts: 4

PostPosted: Sun Aug 14, 2016 4:26 am    Post subject: nginx: [emerg] invalid arguement (cookie) Reply with quote

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
Code:
 # /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
Code:
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
Code:

[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 :)
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 408
Location: France

PostPosted: Sun Aug 14, 2016 12:09 pm    Post subject: Reply with quote

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

++
Gi)
Back to top
View user's profile Send private message
gencol
n00b
n00b


Joined: 22 Nov 2012
Posts: 4

PostPosted: Sun Aug 14, 2016 4:40 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 408
Location: France

PostPosted: Mon Aug 15, 2016 7:23 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
gordonb3
Apprentice
Apprentice


Joined: 01 Jul 2015
Posts: 185

PostPosted: Mon Aug 15, 2016 9:55 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum