Skip to content

Instantly share code, notes, and snippets.

@lxcodes
Forked from sts/haproxy_maintenance.conf
Created October 27, 2016 13:07
Show Gist options
  • Select an option

  • Save lxcodes/37a306cf1a8225e6e3aa7adb62017bbc to your computer and use it in GitHub Desktop.

Select an option

Save lxcodes/37a306cf1a8225e6e3aa7adb62017bbc to your computer and use it in GitHub Desktop.

Revisions

  1. @sts sts renamed this gist Sep 10, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @sts sts renamed this gist Sep 10, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @sts sts revised this gist Sep 10, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions haproxy_maintenance.conf
    Original file line number Diff line number Diff line change
    @@ -31,6 +31,7 @@ backend web
    balance roundrobin
    server web01 127.0.0.1:8080 inter 500 rise 3 fall 1 weight 100 slowstart 30s


    backend web_maintenence
    mode http
    errorfile 503 /etc/haproxy/errors/maintenance.http
  4. @sts sts renamed this gist Sep 10, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. @sts sts revised this gist Sep 10, 2014. 1 changed file with 15 additions and 14 deletions.
    29 changes: 15 additions & 14 deletions haproxy.conf
    Original file line number Diff line number Diff line change
    @@ -15,22 +15,23 @@
    #

    frontend web
    bind 0.0.0.0:80
    mode http
    default_backend web_backend
    # use this in case of real errors
    errorfile 503 /etc/haproxy/errors/maintenance.http
    # maintenance mode - disabled by default
    acl web_maintenance src --
    acl web_maintenence_ex src --
    use_backend web_maintenance if web_maintenance !web_maintenence_ex
    bind 0.0.0.0:80
    mode http
    default_backend web_backend
    # use this in case of real errors
    errorfile 503 /etc/haproxy/errors/maintenance.http
    # maintenance mode - disabled by default
    acl web_maintenance src --
    acl web_maintenence_ex src --
    use_backend web_maintenance if web_maintenance !web_maintenence_ex


    backend web
    mode http
    balance roundrobin
    server web01 127.0.0.1:8080 inter 500 rise 3 fall 1 weight 100 slowstart 30s
    mode http
    balance roundrobin
    server web01 127.0.0.1:8080 inter 500 rise 3 fall 1 weight 100 slowstart 30s

    backend web_maintenence
    mode http
    errorfile 503 /etc/haproxy/errors/maintenance.http
    mode http
    errorfile 503 /etc/haproxy/errors/maintenance.http

  6. @sts sts renamed this gist Sep 10, 2014. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions gistfile1.txt → haproxy.conf
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    #
    # Proof of concept for a HAProxy Controlled Maintenance Page
    # Proof of concept for a HAProxy maintenance mode
    #
    #
    # Control the maintenance page during runtime using the stats socket.
    # Control the maintenance page during runtime using the stats socket:
    #
    # To put the whole site in maintenance mode, for all IPs
    # To put the whole site in maintenance mode (for all IPs):
    # > add acl #0 0.0.0.0/0
    #
    # To exclude your own ip, so your are able to test things
    # To exclude your own ip, so you are able to test things out:
    # > add acl #1 8.8.8.8
    #
    # To exit maintenance mode again simply remove the netmask
    # To exit maintenance mode again simply remove the mask from #0 again:
    # > del acl #0 0.0.0.0/0
    #

  7. @sts sts created this gist Sep 10, 2014.
    36 changes: 36 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    #
    # Proof of concept for a HAProxy Controlled Maintenance Page
    #
    #
    # Control the maintenance page during runtime using the stats socket.
    #
    # To put the whole site in maintenance mode, for all IPs
    # > add acl #0 0.0.0.0/0
    #
    # To exclude your own ip, so your are able to test things
    # > add acl #1 8.8.8.8
    #
    # To exit maintenance mode again simply remove the netmask
    # > del acl #0 0.0.0.0/0
    #

    frontend web
    bind 0.0.0.0:80
    mode http
    default_backend web_backend
    # use this in case of real errors
    errorfile 503 /etc/haproxy/errors/maintenance.http
    # maintenance mode - disabled by default
    acl web_maintenance src --
    acl web_maintenence_ex src --
    use_backend web_maintenance if web_maintenance !web_maintenence_ex

    backend web
    mode http
    balance roundrobin
    server web01 127.0.0.1:8080 inter 500 rise 3 fall 1 weight 100 slowstart 30s

    backend web_maintenence
    mode http
    errorfile 503 /etc/haproxy/errors/maintenance.http