Problem with argument route in upstream

Hi,

I was looking for hours what is the problem with my conf.

I am trying to implement a nginx reverse loadbalancer with tomcat
application servers.
I chose the route method here is the conf :

map $cookie_jsessionid $route_cookie {
~.+.(?P\w+)$ $route;
}

map $request_uri $route_uri {
~jsessionid=.+.(?P\w+)$ $route;
}

upstream antares {
server xxxxx:8000 route=server1;
server yyyy:8000 route=server2;
sticky route $route_cookie $route_uri;
}

server {
listen XXXXX:51001;

access_log /var/log/nginx/c2375.log main;

  location / {
  proxy_buffers 8 4k;
  proxy_busy_buffers_size 16k;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_pass http://antares;

}

}

With this I get on the error.log :
2014/11/18 19:56:40 [emerg] 9520#0: invalid parameter “route=server1” in
/etc/nginx/conf.d/c2375.conf:13

I an using ngninx on rhel 6 with the rpm compile on ngin.org :

nginx version: nginx/1.6.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx
–conf-path=/etc/nginx/nginx.conf
–error-log-path=/var/log/nginx/error.log
–http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid
–lock-path=/var/run/nginx.lock
–http-client-body-temp-path=/var/cache/nginx/client_temp
–http-proxy-temp-path=/var/cache/nginx/proxy_temp
–http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
–http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
–http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx
–group=nginx --with-http_ssl_module --with-http_realip_module
–with-http_addition_module --with-http_sub_module
–with-http_dav_module --with-http_flv_module --with-http_mp4_module
–with-http_gunzip_module --with-http_gzip_static_module
–with-http_random_index_module --with-http_secure_link_module
–with-http_stub_status_module --with-http_auth_request_module
–with-mail --with-mail_ssl_module --with-file-aio --with-ipv6
–with-http_spdy_module --with-cc-opt=‘-O2 -g -pipe
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
–param=ssp-buffer-size=4 -m64 -mtune=generic’

Any idea ?

Rodriguez Daniel
Administrateur Infrastructures Clientes
Groupe SOFTWAY MEDICAL
Tel: 04 42 97 66 36
Gsm : 06 59 75 17 58

www.softwaymedical.frhttp://www.softwaymedical.fr

On 19.11.2014 00:25, RODRIGUEZ Daniel wrote:

upstream antares {

   proxy_set_header Host $host;

–group=nginx --with-http_ssl_module --with-http_realip_module
Any idea ?
The sticky directive is only available in nginx-plus [1]

[1] NGINX Application Platform | NGINX

On Tue, Nov 18, 2014 at 10:25:50PM +0100, RODRIGUEZ Daniel wrote:

Hi there,

upstream antares {
server xxxxx:8000 route=server1;
server yyyy:8000 route=server2;
sticky route $route_cookie $route_uri;
}

With this I get on the error.log :
2014/11/18 19:56:40 [emerg] 9520#0: invalid parameter “route=server1” in
/etc/nginx/conf.d/c2375.conf:13

Any idea ?

The error.log indicates that your nginx does not accept that parameter
for the “server” directive within the “upstream” block.

The documentation is at
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server

It includes the line “Additionally, the following parameters are
available
as part of our commercial subscription:”.

f

Francis D. [email protected]

Hi,

you can use the nginx-sticky-module if you need sticky sessions
https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng

it just has no way to extract the routing-info from tomcat-routes (yet,
we’re working on it) and comes with an own cookie, but is
production-ready

cheers,

mex

Posted at Nginx Forum:

Thanks I am going to have a look on this module

Envoyé de mon iPhone

Tanks for your reply
It means there is only the ip_hash solution on the free version?

Envoyé de mon iPhone