ulabs-org / docker-nginx-sticky Goto Github PK
View Code? Open in Web Editor NEWThis is simple and slim (≈8mb) docker-container with builtin nginx-sticky-module-ng
Home Page: https://hub.docker.com/r/imkulikov/nginx-sticky/
License: MIT License
This is simple and slim (≈8mb) docker-container with builtin nginx-sticky-module-ng
Home Page: https://hub.docker.com/r/imkulikov/nginx-sticky/
License: MIT License
Hi,
New to this, and am trying to use nginx as a loadbalancer with sticky jsessionid.
I've tried using sticky route and sticky learn , both are failing. Attched is my proxy.conf (txt to attach here) which I add to your image through Dockerfile
commands to launch
for learn
[admin@esn1 nginxLB]$ docker run -it --name wild-balancer -p 80:80 --link lca1:lca1 --link lca2:lca2 --link lca3:lca3 --network=wildnetwork --ip 172.28.5.4 nginx-sticky
2018/02/18 14:19:36 [emerg] 1#1: invalid arguement (learn) in /etc/nginx/conf.d/proxy.conf:29
nginx: [emerg] invalid arguement (learn) in /etc/nginx/conf.d/proxy.conf:29
for route
[admin@esn1 nginxLB]$ docker run -it --name wild-balancer -p 80:80 --link lca1:lca1 --link lca2:lca2 --link lca3:lca3 --network=wildnetwork --ip 172.28.5.4 nginx-sticky
2018/02/17 22:26:51 [emerg] 1#1: invalid arguement (route) in /etc/nginx/conf.d/proxy.conf:21
nginx: [emerg] invalid arguement (route) in /etc/nginx/conf.d/proxy.conf:21
any help would be appreciated.
[proxy.txt](https://github.com/ulabs-org/docker-nginx-sticky/files/1734788/proxy.txt)
# Extract the data after the final period (.) in the
# JSESSIONID cookie and store it in the $route_cookie variable.
map $cookie_jsessionid $route_cookie {
~.+\.(?P<route>w+)$ $route;
}
# Search the URL for a trailing jsessionid parameter, extract the
# data after the final period (.), and store it in
# the $route_uri variable.
map $request_uri $route_uri {
jsessionid=.+\.(?P<route>w+)$ $route;
}
upstream tomcat {
server lca2:8080;
server lca3:8080;
server lca1:8080;
# Session persistence based on the jvmRoute value in
# the JSESSION ID cookie
#sticky route $route_cookie $route_uri;
# Uncomment the following directive (and comment the preceding
# 'sticky route' and JSESSIONID 'map' directives) for session
# persistence based on the JSESSIONID
sticky learn create=$upstream_cookie_JSESSIONID
lookup=$cookie_JSESSIONID
zone=client_sessions:1m;
}
server {
listen 80;
server_name wild-balancer;
error_log /dev/stdout error;
access_log /dev/stdout;
root /usr/share/nginx/html;
# For service: TOMCAT
location /home {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.