Skip to content

Instantly share code, notes, and snippets.

@mattdeboard
Created April 17, 2014 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattdeboard/1c908296da8d654254f8 to your computer and use it in GitHub Desktop.
Save mattdeboard/1c908296da8d654254f8 to your computer and use it in GitHub Desktop.
upstream nuxeo {
server nuxeo-00.example.com:8080;
server nuxeo-01.example.com:8080;
}
map $cookie_jsessionid $sticky_backend {
default nuxeo;
*.nxworker1 nuxeo-00.example.com:8080;
*.nxworker2 nuxeo-01.example.com:8080;
}
server {
listen 443 ssl;
server_name nuxeo-staging.example.com;
ssl_certificate /etc/ssl/certs/cl-wildcard-cert.chained.crt;
ssl_certificate_key /etc/ssl/certs/cl-wildcard-cert.key;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location ^~ / {
error_page 502 @rrfallback;
proxy_pass http://$sticky_backend;
}
location @rrfallback {
proxy_pass http://nuxeo;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment