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