Merge lp://staging/~jseutter/charms/precise/haproxy/errorfiles-2 into lp://staging/~dpb/charms/precise/haproxy/trunk
Status: | Merged |
---|---|
Merged at revision: | 72 |
Proposed branch: | lp://staging/~jseutter/charms/precise/haproxy/errorfiles-2 |
Merge into: | lp://staging/~dpb/charms/precise/haproxy/trunk |
Diff against target: |
161 lines (+62/-11) 2 files modified
hooks/hooks.py (+27/-7) hooks/test_hooks.py (+35/-4) |
To merge this branch: | bzr merge lp://staging/~jseutter/charms/precise/haproxy/errorfiles-2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Landscape | Pending | ||
Landscape | Pending | ||
Review via email: mp+178396@code.staging.launchpad.net |
Description of the change
This change adds support for error files to the haproxy charm.
Background:
When Landscape is down for maintenance (or some other reason), we display an custom error page. A request goes through Apache -> HAProxy -> backend service, and if the backend service is down, HAProxy serves an error page. This is how staging is configured.
Now that Juju is used, HAProxy runs on a different unit than the backend service and no longer has direct access to the html error pages located in the Landscape source tree. This branch takes the errorfiles communicated by the landscape charm and configures HAProxy to use them.
The end result is an HAProxy config file that contains sections like this:
listen appserver 0.0.0.0:81
mode http
balance leastconn
option httpchk GET / HTTP/1.0
errorfile 403 /var/lib/
errorfile 500 /var/lib/
errorfile 502 /var/lib/
errorfile 503 /var/lib/
errorfile 504 /var/lib/
server appserver 10.0.3.9:8080 check inter 2000 rise 2 fall 5 maxconn 50
server appserver 10.0.3.9:8081 check inter 2000 rise 2 fall 5 maxconn 50