Skip to content

Commit f5d76ee

Browse files
authored
remove separate tls listen for haproxy (#543)
* remove separate tls listen for haproxy haproxy has natively supported http/2 for a _long_ time. This listen (combined frontend/backend) was added long ago before haproxy supported http/2 (back when it was called spdy). Drop the http server config for http/2, and move all binds back into the main frontend. * fix tls redirect acl
1 parent ad7b9ca commit f5d76ee

File tree

3 files changed

+9
-57
lines changed

3 files changed

+9
-57
lines changed

salt/haproxy/config/haproxy.cfg.jinja

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ defaults
8383
errorfile 504 /etc/haproxy/errors/504.http
8484

8585

86-
listen tls:
86+
frontend main
87+
# HTTP Binds
88+
bind :20000
89+
bind :20001 accept-proxy
90+
bind 0.0.0.0:80
91+
bind :::80
92+
93+
# HTTPS Binds
8794
# Advertise http/1.1 over NPN to enable TLS False Start
8895
bind :20003 ssl alpn h2,http/1.1 crt star.python.org.pem
8996
bind :20005 ssl alpn h2,http/1.1 crt star.pypa.io.pem
@@ -95,27 +102,6 @@ listen tls:
95102
bind :20010 ssl alpn h2,http/1.1 crt star.python.org.pem crt star.pypa.io.pem crt star.pyfound.org.pem crt speed.pypy.org.pem crt www.pycon.org.pem crt jython.org.pem crt salt-public.psf.io.pem crt planetpython.org.pem crt bugs.python.org.pem
96103
bind :20011 accept-proxy ssl alpn h2,http/1.1 crt star.python.org.pem crt star.pypa.io.pem crt star.pyfound.org.pem crt speed.pypy.org.pem crt www.pycon.org.pem crt jython.org.pem crt salt-public.psf.io.pem crt planetpython.org.pem crt bugs.python.org.pem
97104

98-
mode http
99-
100-
option httplog
101-
102-
# Capture the user agent in the log
103-
capture request header User-Agent len 512
104-
# Capture X-Forwarded-For in the log
105-
capture request header X-Forwarded-For len 64
106-
107-
http-request set-header X-Client-IP %[src]
108-
109-
server default 127.0.0.1:19001
110-
111-
112-
frontend main
113-
bind :20000
114-
bind :20001 accept-proxy
115-
bind 0.0.0.0:80
116-
bind :::80
117-
bind 127.0.0.1:19001 # This is our TLS socket.
118-
119105
# Define a stick table for all services
120106
stick-table type ipv6 size 100k expire 30s store http_req_rate(10s)
121107
# Track all requests using a single counter
@@ -147,7 +133,7 @@ frontend main
147133
use_backend letsencrypt-well-known if letsencrypt-well-known-acl
148134

149135
# Determine if this request has TLS on the client side or not.
150-
acl is_tls dst_port 19001
136+
acl is_tls ssl_fc
151137

152138
acl our_domains hdr(host) -i -f /etc/haproxy/our_domains
153139

salt/haproxy/config/nginx-http2.conf.jinja

Lines changed: 0 additions & 23 deletions
This file was deleted.

salt/haproxy/init.sls

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,6 @@ haproxy-ocsp:
117117
{% endif %}
118118

119119

120-
/etc/nginx/sites.d/http2.conf:
121-
file.managed:
122-
- source: salt://haproxy/config/nginx-http2.conf.jinja
123-
- template: jinja
124-
- user: root
125-
- group: root
126-
- mode: "0644"
127-
- require:
128-
- file: /etc/nginx/sites.d/
129-
130-
131120
/etc/nginx/sites.d/redirect.conf:
132121
file.managed:
133122
- source: salt://haproxy/config/nginx-redirect.conf.jinja

0 commit comments

Comments
 (0)