Git Product home page Git Product logo

docker-nginx-sticky's People

Contributors

im-kulikov avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

docker-nginx-sticky's Issues

sticky directive not recognized

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;


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.