August 2017
Intermediate to advanced
278 pages
8h 53m
English
map $cookie_route $route_cookie {
~(?P<route>\w+)$ $route;
}
map $arg_route $route_uri {
~ (?P<route>\w+)$ $route;
}
upstream stickyapp {
server 127.0.0.1:8080 route=server1;
server 127.0.0.1:8081 route=server2;
server 127.0.0.1:8082 route=server3;
sticky route $route_cookie $route_uri;
}
server {
listen 80;
server_name session.nginxcookbook.com;
access_log /var/log/nginx/sessiontest-access.log combined;
location / {
proxy_pass http://stickyapp;
}
status_zone sticky-app;
}
Read now
Unlock full access