Skip to content

Instantly share code, notes, and snippets.

@paramah
Last active December 25, 2015 20:58
Show Gist options
  • Save paramah/7038730 to your computer and use it in GitHub Desktop.
Save paramah/7038730 to your computer and use it in GitHub Desktop.

Revisions

  1. paramah revised this gist Apr 25, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xmpp
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Super

    upstream xmpp {
    server 10.0.0.10:5280;
    server 10.0.0.11:5280;
  2. paramah created this gist Oct 18, 2013.
    38 changes: 38 additions & 0 deletions xmpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    upstream xmpp {
    server 10.0.0.10:5280;
    server 10.0.0.11:5280;
    server 10.0.0.12:5280;
    }

    map $cookie_vroute $sticky {
    default xmpp;
    v1 10.0.0.10:5280;
    v2 10.0.0.11:5280;
    v3 10.0.0.12:5280;
    }

    server {
    listen 80;
    server_name myxmpp.local;

    location /xmpp {
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_connect_timeout 5;
    proxy_buffering off;
    proxy_pass http://$sticky$uri;
    proxy_read_timeout 70;
    keepalive_timeout 70;
    send_timeout 70;
    error_page 502 = @xmpp_fallback;
    }

    location @xmpp_fallback {
    proxy_set_header Host $http_host;
    proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
    proxy_redirect off;
    proxy_connect_timeout 5;
    proxy_buffering off;
    proxy_pass http://xmpp;
    }
    }