summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez Piedehierro <palvarez89@gmail.com>2017-10-24 23:14:09 +0100
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2017-11-06 17:30:20 +0000
commitd33ad295e4f727ab227c0a964004a6d8bd842382 (patch)
treee74957f24e55a6a8e78c3bcb5cba8787e0afe1d8
parent4792902961d8ae9d14c098d3de037ef176772916 (diff)
downloadinfrastructure-d33ad295e4f727ab227c0a964004a6d8bd842382.tar.gz
frontend: Add rule to redirect Gitlab IRC bot requestspedro/gitlab-bot-fixes-2
-rw-r--r--baserock_frontend/haproxy.cfg11
1 files changed, 10 insertions, 1 deletions
diff --git a/baserock_frontend/haproxy.cfg b/baserock_frontend/haproxy.cfg
index c0983dd7..193effd5 100644
--- a/baserock_frontend/haproxy.cfg
+++ b/baserock_frontend/haproxy.cfg
@@ -32,7 +32,13 @@ defaults
frontend http-in
# All HTTP traffic is redirected to HTTPS using the '301 Moved' HTTP code.
bind *:80
- redirect scheme https code 301
+
+ acl host_webhook hdr(host) -m beg -i webhook
+ use_backend gitlab_webhook_http if host_webhook
+
+ # Don't redirect if is a webhook. We could generate SSL certs for this
+ # host to avoid Gitlab complaining.
+ redirect scheme https code 301 if !host_webhook
frontend https-in
# We do 'SSL termination' with HAProxy. So secure requests are received in
@@ -102,3 +108,6 @@ backend baserock_webserver_http
backend baserock_paste_http
server baserock_paste 10.3.0.13:7777
+
+backend gitlab_webhook_http
+ server baserock_gitlab_bot 10.3.0.13:1337