Advertisement
Guest User

Nginx Sticky Config File

a guest
Dec 3rd, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.85 KB | None | 0 0
  1. # we're in the http context here
  2. map $http_upgrade $connection_upgrade {
  3.   default upgrade;
  4.   ''      close;
  5. }
  6.  
  7. ################################################
  8. #  Load Balancer
  9. ################################################
  10. upstream backend {
  11.     sticky path=/;
  12.     server 10.1.1.1;
  13.     server 10.2.2.2;
  14. }
  15.  
  16. server {
  17.     listen 80;
  18.     listen [::]:80;
  19.     server_name www.abc.com www.ddp.abc.com;
  20.  
  21.     location / {
  22.         proxy_pass http://backend;
  23.         proxy_http_version 1.1;
  24.         proxy_set_header Upgrade $http_upgrade;
  25.         proxy_set_header Connection $connection_upgrade;
  26.         proxy_set_header Host $host;
  27.         proxy_set_header X-Real-IP $remote_addr;
  28.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  29.         proxy_set_header X-Forwarded-Proto $scheme;
  30.         proxy_redirect off;
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement