Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit f3fb89c

Browse files
author
Feng Honglin
committed
Merge pull request #44 from docker/staging
ver 1.4
2 parents b002007 + 6f1b7e6 commit f3fb89c

20 files changed

+326
-166
lines changed

Dockerfile

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
11
FROM alpine:edge
22
MAINTAINER Feng Honglin <[email protected]>
33

4-
# Install tini, haproxy, pip and the dockercloud-haproxy python package:
5-
RUN apk --no-cache add \
6-
tini \
7-
haproxy \
8-
py-pip \
9-
&& apk --no-cache add --virtual deps git \
10-
&& pip install --upgrade \
11-
pip \
12-
&& apk del deps \
13-
# Clean up obsolete files:
14-
&& rm -rf \
15-
# Clean up any temporary files:
16-
/tmp/* \
17-
# Clean up the pip cache:
18-
/root/.cache \
19-
# Remove any compiled python files (compile on demand):
20-
`find / -regex '.*\.py[co]'`
4+
COPY . /haproxy-src
215

22-
COPY reload.sh /reload.sh
23-
COPY . haproxy-src/
24-
RUN cd /haproxy-src/ && \
25-
pip install . \
26-
# Clean up obsolete files:
27-
&& rm -rf \
28-
# Clean up any temporary files:
29-
/tmp/* \
30-
# Clean up the pip cache:
31-
/root/.cache \
32-
# Remove any compiled python files (compile on demand):
33-
`find / -regex '.*\.py[co]'`
6+
RUN apk update && \
7+
apk --no-cache add tini haproxy py-pip build-base python-dev ca-certificates && \
8+
cp /haproxy-src/reload.sh /reload.sh && \
9+
cd /haproxy-src && \
10+
pip install -r requirements.txt && \
11+
pip install . && \
12+
apk del build-base python-dev && \
13+
rm -rf "/tmp/*" "/root/.cache" `find / -regex '.*\.py[co]'`
3414

3515
ENV RSYSLOG_DESTINATION=127.0.0.1 \
3616
MODE=http \
@@ -42,7 +22,7 @@ ENV RSYSLOG_DESTINATION=127.0.0.1 \
4222
STATS_AUTH="stats:stats" \
4323
SSL_BIND_OPTIONS=no-sslv3 \
4424
SSL_BIND_CIPHERS="ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:DHE-DSS-AES128-SHA:DES-CBC3-SHA" \
45-
HEALTH_CHECK="check"
25+
HEALTH_CHECK="check inter 2000 rise 2 fall 3"
4626

4727
EXPOSE 80 443 1936
4828
ENTRYPOINT ["tini", "--"]

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,25 +132,26 @@ Settings in this part is immutable, you have to redeploy HAProxy service to make
132132

133133
|Environment Variable|Default|Description|
134134
|:-----:|:-----:|:----------|
135-
|ADDITIONAL_SERVICES||list of additional services to balance (es: `prj1:web,prj2:sql`). Discovery will be based on `com.docker.compose.[project|service]` container labels. This environment variable only works on compose v2, and the referenced services must be on a network accessible to this containers.|
135+
|ADDITIONAL_SERVICES| |list of additional services to balance (es: `prj1:web,prj2:sql`). Discovery will be based on `com.docker.compose.[project|service]` container labels. This environment variable only works on compose v2, and the referenced services must be on a network accessible to this containers.|
136136
|BALANCE|roundrobin|load balancing algorithm to use. Possible values include: `roundrobin`, `static-rr`, `source`, `leastconn`. See:[HAProxy:balance](https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-balance)|
137-
|CA_CERT_FILE||the path of a ca-cert file. This allows you to mount your ca-cert file directly from a volume instead of from envvar. If set, `CA_CERT` envvar will be ignored. Possible value: `/cacerts/cert0.pem`|
138-
|CA_CERT|<empty>|CA cert for haproxy to verify the client. Use the same format as `DEFAULT_SSL_CERT`|
139-
|CERT_FOLDER||the path of certificates. This allows you to mount your certificate files directly from a volume instead of from envvars. If set, `DEFAULT_SSL_CERT` and `SSL_CERT` from linked services are ignored. Possible value:`/certs/`|
140-
|DEFAULT_SSL_CERT||Default ssl cert, a pem file content with private key followed by public certificate, '\n'(two chars) as the line separator. should be formatted as one line - see [SSL Termination](#ssl-termination)|
141-
|EXTRA_BIND_SETTINGS|<empty>|comma-separated string(`<port>:<setting>`) of extra settings, and each part will be appended to the related port bind section in the configuration file. To escape comma, use `\,`. Possible value: `443:accept-proxy, 80:name http`|
142-
|EXTRA_DEFAULT_SETTINGS|<empty>|comma-separated string of extra settings, and each part will be appended to DEFAULT section in the configuration file. To escape comma, use `\,`|
143-
|EXTRA_GLOBAL_SETTINGS|<empty>|comma-separated string of extra settings, and each part will be appended to GLOBAL section in the configuration file. To escape comma, use `\,`. Possible value: `tune.ssl.cachesize 20000, tune.ssl.default-dh-param 2048`|
144-
|EXTRA_SSL_CERTS||list of extra certificate names separated by comma, eg. `CERT1, CERT2, CERT3`. You also need to specify each certificate as separate env variables like so: `CERT1="<cert-body1>"`, `CERT2="<cert-body2>"`, `CERT3="<cert-body3>"`|
137+
|CA_CERT_FILE| |the path of a ca-cert file. This allows you to mount your ca-cert file directly from a volume instead of from envvar. If set, `CA_CERT` envvar will be ignored. Possible value: `/cacerts/cert0.pem`|
138+
|CA_CERT| |CA cert for haproxy to verify the client. Use the same format as `DEFAULT_SSL_CERT`|
139+
|CERT_FOLDER| |the path of certificates. This allows you to mount your certificate files directly from a volume instead of from envvars. If set, `DEFAULT_SSL_CERT` and `SSL_CERT` from linked services are ignored. Possible value:`/certs/`|
140+
|DEFAULT_SSL_CERT| |Default ssl cert, a pem file content with private key followed by public certificate, '\n'(two chars) as the line separator. should be formatted as one line - see [SSL Termination](#ssl-termination)|
141+
|EXTRA_BIND_SETTINGS| |comma-separated string(`<port>:<setting>`) of extra settings, and each part will be appended to the related port bind section in the configuration file. To escape comma, use `\,`. Possible value: `443:accept-proxy, 80:name http`|
142+
|EXTRA_DEFAULT_SETTINGS| |comma-separated string of extra settings, and each part will be appended to DEFAULT section in the configuration file. To escape comma, use `\,`|
143+
|EXTRA_FRONTEND_SETTINGS_\<PORT\>| |comma-separated string of extra settings, and each part will be appended frontend section with the port number specified in the name of the envvar. To escape comma, use `\,`. E.g. `EXTRA_FRONTEND_SETTINGS_80=balance source, maxconn 2000`|
144+
|EXTRA_GLOBAL_SETTINGS| |comma-separated string of extra settings, and each part will be appended to GLOBAL section in the configuration file. To escape comma, use `\,`. Possible value: `tune.ssl.cachesize 20000, tune.ssl.default-dh-param 2048`|
145+
|EXTRA_SSL_CERTS| |list of extra certificate names separated by comma, eg. `CERT1, CERT2, CERT3`. You also need to specify each certificate as separate env variables like so: `CERT1="<cert-body1>"`, `CERT2="<cert-body2>"`, `CERT3="<cert-body3>"`|
145146
|HEALTH_CHECK|check|set health check on each backend route, possible value: "check inter 2000 rise 2 fall 3". See:[HAProxy:check](https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#5.2-check)|
146-
|HTTP_BASIC_AUTH|<empty>|a comma-separated list of credentials(`<user>:<pass>`) for HTTP basic auth, which applies to all the backend routes. To escape comma, use `\,`. *Attention:* DO NOT rely on this for authentication in production|
147+
|HTTP_BASIC_AUTH| |a comma-separated list of credentials(`<user>:<pass>`) for HTTP basic auth, which applies to all the backend routes. To escape comma, use `\,`. *Attention:* DO NOT rely on this for authentication in production|
147148
|MAXCONN|4096|sets the maximum per-process number of concurrent connections.|
148149
|MODE|http|mode of load balancing for HAProxy. Possible values include: `http`, `tcp`, `health`|
149-
|MONITOR_PORT|<empty>|the port number where monitor_uri should be added to. Use together with `MONTIOR_URI`. Possible value: `80`|
150-
|MONITOR_URI|<empty>|the exact URI which we want to intercept to return HAProxy's health status instead of forwarding the request.See: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-monitor-uri. Possible value: `/ping`|
150+
|MONITOR_PORT| |the port number where monitor_uri should be added to. Use together with `MONTIOR_URI`. Possible value: `80`|
151+
|MONITOR_URI| |the exact URI which we want to intercept to return HAProxy's health status instead of forwarding the request.See: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-monitor-uri. Possible value: `/ping`|
151152
|OPTION|redispatch|comma-separated list of HAProxy `option` entries to the `default` section.|
152153
|RSYSLOG_DESTINATION|127.0.0.1|the rsyslog destination to where HAProxy logs are sent|
153-
|SSL_BIND_CIPHERS||explicitly set which SSL ciphers will be used for the SSL server. This sets the HAProxy `ssl-default-bind-ciphers` configuration setting.|
154+
|SSL_BIND_CIPHERS| |explicitly set which SSL ciphers will be used for the SSL server. This sets the HAProxy `ssl-default-bind-ciphers` configuration setting.|
154155
|SSL_BIND_OPTIONS|no-sslv3|explicitly set which SSL bind options will be used for the SSL server. This sets the HAProxy `ssl-default-bind-options` configuration setting. The default will allow only TLSv1.0+ to be used on the SSL server.|
155156
|STATS_AUTH|stats:stats|username and password required to access the Haproxy stats.|
156157
|STATS_PORT|1936|port for the HAProxy stats section. If this port is published, stats can be accessed at `http://<host-ip>:<STATS_PORT>/`
@@ -160,7 +161,7 @@ Settings in this part is immutable, you have to redeploy HAProxy service to make
160161

161162
Settings here can overwrite the settings in HAProxy, which are only applied to the linked services. If run in Docker Cloud, when the service redeploys, joins or leaves HAProxy service, HAProxy service will automatically update itself to apply the changes
162163

163-
|env var|description|
164+
|Environment Variable|Description|
164165
|:-----:|:----------|
165166
|APPSESSION|sticky session option, possible value `JSESSIONID len 52 timeout 3h`. See:[HAProxy:appsession](http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-appsession)|
166167
|BALANCE|load balancing algorithm to use. Possible values include: `roundrobin`, `static-rr`, `source`, `leastconn`. See:[HAProxy:balance](https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4-balance)|
@@ -185,7 +186,7 @@ Check [the HAProxy configuration manual](http://cbonte.github.io/haproxy-dconv/c
185186

186187
Both virtual host and virtual path can be specified in environment variable `VIRTUAL_HOST`, which is a set of comma separated urls with the format of `[scheme://]domain[:port][/path]`.
187188

188-
|item|default|description|
189+
|Item|Default|Description|
189190
|:---:|:-----:|:---------|
190191
|scheme|http|possible values: `http`, `https`, `wss`|
191192
|domain||virtual host. `*` can be used as the wildcard|
@@ -194,7 +195,7 @@ Both virtual host and virtual path can be specified in environment variable `VIR
194195

195196
#### examples of matching
196197

197-
|virtual host|match|not match|
198+
|Virtual host|Match|Not match|
198199
|:-----------|:----|:--------|
199200
|http://example.com|example.com|www.example.com|
200201
|example.com|example.com|www.example.com|

haproxy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.3"
1+
__version__ = "1.4"

haproxy/config.py

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,53 @@ def parse_extra_bind_settings(extra_bind_settings):
1313
return bind_dict
1414

1515

16+
def parse_extra_frontend_settings(envvars):
17+
settings_dict = {}
18+
if isinstance(envvars, os._Environ) or isinstance(envvars, dict):
19+
frontend_settings_pattern = re.compile(r"^EXTRA_FRONTEND_SETTINGS_(\d{1,5})$")
20+
for k, v in envvars.iteritems():
21+
match = frontend_settings_pattern.match(k)
22+
if match:
23+
port = match.group(1)
24+
settings = [x.strip().replace("\,", ",") for x in re.split(r'(?<!\\),', v.strip())]
25+
if port in settings_dict:
26+
settings_dict[port].extend(settings)
27+
else:
28+
settings_dict[port] = settings
29+
return settings_dict
30+
31+
1632
# envvar
33+
ADDITIONAL_SERVICES = os.getenv("ADDITIONAL_SERVICES")
34+
API_AUTH = os.getenv("DOCKERCLOUD_AUTH")
35+
BALANCE = os.getenv("BALANCE", "roundrobin")
36+
CA_CERT_FILE = os.getenv("CA_CERT_FILE")
37+
CERT_FOLDER = os.getenv("CERT_FOLDER")
38+
DEBUG = os.getenv("DEBUG", False)
39+
DEFAULT_CA_CERT = os.getenv("CA_CERT")
1740
DEFAULT_SSL_CERT = os.getenv("DEFAULT_SSL_CERT") or os.getenv("SSL_CERT")
41+
EXTRA_BIND_SETTINGS = parse_extra_bind_settings(os.getenv("EXTRA_BIND_SETTINGS"))
42+
EXTRA_DEFAULT_SETTINGS = os.getenv("EXTRA_DEFAULT_SETTINGS")
43+
EXTRA_FRONTEND_SETTINGS = parse_extra_frontend_settings(os.environ)
44+
EXTRA_GLOBAL_SETTINGS = os.getenv("EXTRA_GLOBAL_SETTINGS")
1845
EXTRA_SSL_CERT = os.getenv("EXTRA_SSL_CERTS")
19-
DEFAULT_CA_CERT = os.getenv("CA_CERT")
46+
HAPROXY_CONTAINER_URI = os.getenv("DOCKERCLOUD_CONTAINER_API_URI")
47+
HAPROXY_SERVICE_URI = os.getenv("DOCKERCLOUD_SERVICE_API_URI")
48+
HEALTH_CHECK = os.getenv("HEALTH_CHECK", "check inter 2000 rise 2 fall 3")
49+
HTTP_BASIC_AUTH = os.getenv("HTTP_BASIC_AUTH")
2050
MAXCONN = os.getenv("MAXCONN", "4096")
2151
MODE = os.getenv("MODE", "http")
52+
MONITOR_PORT = os.getenv("MONITOR_PORT")
53+
MONITOR_URI = os.getenv("MONITOR_URI")
2254
OPTION = os.getenv("OPTION", "redispatch, httplog, dontlognull, forwardfor")
2355
RSYSLOG_DESTINATION = os.getenv("RSYSLOG_DESTINATION", "127.0.0.1")
2456
SSL_BIND_CIPHERS = os.getenv("SSL_BIND_CIPHERS")
2557
SSL_BIND_OPTIONS = os.getenv("SSL_BIND_OPTIONS")
2658
STATS_AUTH = os.getenv("STATS_AUTH", "stats:stats")
2759
STATS_PORT = os.getenv("STATS_PORT", "1936")
2860
TIMEOUT = os.getenv("TIMEOUT", "connect 5000, client 50000, server 50000")
29-
HEALTH_CHECK = os.getenv("HEALTH_CHECK", "check inter 2000 rise 2 fall 3")
30-
EXTRA_GLOBAL_SETTINGS = os.getenv("EXTRA_GLOBAL_SETTINGS")
31-
EXTRA_DEFAULT_SETTINGS = os.getenv("EXTRA_DEFAULT_SETTINGS")
32-
EXTRA_BIND_SETTINGS = parse_extra_bind_settings(os.getenv("EXTRA_BIND_SETTINGS"))
33-
HTTP_BASIC_AUTH = os.getenv("HTTP_BASIC_AUTH")
34-
MONITOR_URI = os.getenv("MONITOR_URI")
35-
MONITOR_PORT = os.getenv("MONITOR_PORT")
36-
BALANCE = os.getenv("BALANCE", "roundrobin")
37-
HAPROXY_CONTAINER_URI = os.getenv("DOCKERCLOUD_CONTAINER_API_URI")
38-
HAPROXY_SERVICE_URI = os.getenv("DOCKERCLOUD_SERVICE_API_URI")
39-
API_AUTH = os.getenv("DOCKERCLOUD_AUTH")
40-
CA_CERT_FILE = os.getenv("CA_CERT_FILE")
41-
CERT_FOLDER = os.getenv("CERT_FOLDER")
42-
ADDITIONAL_SERVICES = os.environ.get("ADDITIONAL_SERVICES")
43-
DEBUG = os.getenv("DEBUG", False)
61+
62+
# global
4463
LINK_MODE = ""
4564

4665
# const

haproxy/haproxycfg.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,12 @@ def _config_backend_sections(self):
309309
for service_alias in services_aliases:
310310
backend = BackendHelper.get_backend_section(details, routes, vhosts, service_alias, self.routes_added)
311311

312-
if BackendHelper.check_backend_has_routes(backend):
313-
if not service_alias:
314-
if self.require_default_route:
315-
cfg["backend default_service"] = backend
312+
if not service_alias:
313+
if self.require_default_route:
314+
cfg["backend default_service"] = backend
315+
else:
316+
if get_service_attribute(details, "virtual_host", service_alias):
317+
cfg["backend SERVICE_%s" % service_alias] = backend
316318
else:
317-
if get_service_attribute(details, "virtual_host", service_alias):
318-
cfg["backend SERVICE_%s" % service_alias] = backend
319-
else:
320-
cfg["backend default_service"] = backend
319+
cfg["backend default_service"] = backend
321320
return cfg

haproxy/helper/backend_helper.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,4 @@ def get_basic_auth_setting(basic_auth):
155155
if basic_auth:
156156
setting.append("acl need_auth http_auth(haproxy_userlist)")
157157
setting.append("http-request auth realm haproxy_basic_auth if !need_auth")
158-
return setting
159-
160-
161-
def check_backend_has_routes(backend):
162-
for b in backend:
163-
if b.startswith("server"):
164-
return True
165-
return False
158+
return setting

haproxy/helper/cloud_link_helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from multiprocessing.pool import ThreadPool
1+
from gevent.pool import Pool
22

33
from haproxy.config import SERVICE_NAME_MATCH
44
from haproxy.utils import get_uuid_from_resource_uri, fetch_remote_obj
55

66
LINKED_CONTAINER_CACHE = {}
77

8+
pool = Pool(size=5)
9+
810

911
def get_cloud_links(haproxy_container):
1012
links = _init_links(haproxy_container.linked_to_container)
@@ -41,7 +43,7 @@ def _get_new_added_link_uri(container_object_cache, links):
4143

4244

4345
def _get_container_object_from_uri(container_uris):
44-
pool = ThreadPool(processes=10)
46+
global pool
4547
container_objects = pool.map(fetch_remote_obj, container_uris)
4648
return container_objects
4749

haproxy/helper/frontend_helper.py

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections import OrderedDict
22

3-
from haproxy.config import EXTRA_BIND_SETTINGS, MONITOR_URI, MONITOR_PORT, MAXCONN
3+
from haproxy.config import EXTRA_BIND_SETTINGS, EXTRA_FRONTEND_SETTINGS, MONITOR_URI, MONITOR_PORT, MAXCONN
44

55

66
def check_require_default_route(routes, routes_added):
@@ -94,16 +94,27 @@ def config_common_part(port, ssl_bind_string, vhosts):
9494
frontend_section = []
9595
bind_string, ssl = get_bind_string(port, ssl_bind_string, vhosts)
9696
frontend_section.append("bind :%s" % bind_string)
97+
98+
# add x-forwarded-porto header
9799
if ssl:
98100
frontend_section.append("reqadd X-Forwarded-Proto:\ https")
101+
else:
102+
frontend_section.append("reqadd X-Forwarded-Proto:\ http")
99103

100-
# add websocket acl rule
101-
frontend_section.append("acl is_websocket hdr(Upgrade) -i WebSocket")
104+
# add maxconn
105+
frontend_section.append("maxconn %s" % MAXCONN)
102106

103107
# add monitor uri
104108
if port == MONITOR_PORT and MONITOR_URI:
105109
frontend_section.append("monitor-uri %s" % MONITOR_URI)
106110
monitor_uri_configured = True
111+
112+
# add extra frontend setting
113+
if EXTRA_FRONTEND_SETTINGS and port in EXTRA_FRONTEND_SETTINGS:
114+
frontend_section.extend(EXTRA_FRONTEND_SETTINGS[port])
115+
116+
# add websocket acl rule
117+
frontend_section.append("acl is_websocket hdr(Upgrade) -i WebSocket")
107118
return frontend_section, monitor_uri_configured
108119

109120

@@ -124,19 +135,32 @@ def get_bind_string(port, ssl_bind_string, vhosts):
124135
def config_default_frontend(ssl_bind_string):
125136
cfg = OrderedDict()
126137
monitor_uri_configured = False
127-
frontend = [("bind :80 %s" % EXTRA_BIND_SETTINGS.get('80', "")).strip()]
128-
if ssl_bind_string:
129-
frontend.append(
130-
("bind :443 %s %s" % (ssl_bind_string, EXTRA_BIND_SETTINGS.get('443', ""))).strip())
131-
frontend.append("reqadd X-Forwarded-Proto:\ https")
138+
frontend = [("bind :80 %s" % EXTRA_BIND_SETTINGS.get('80', "")).strip(),
139+
"reqadd X-Forwarded-Proto:\ http", "maxconn %s" % MAXCONN]
132140

133-
if MONITOR_URI and (MONITOR_PORT == '80' or MONITOR_PORT == '443'):
141+
if MONITOR_URI and MONITOR_PORT == '80':
134142
frontend.append("monitor-uri %s" % MONITOR_URI)
135143
monitor_uri_configured = True
136144

137-
frontend.append("maxconn %s" % MAXCONN)
145+
if "80" in EXTRA_FRONTEND_SETTINGS:
146+
frontend.extend(EXTRA_FRONTEND_SETTINGS["80"])
147+
138148
frontend.append("default_backend default_service")
139-
cfg["frontend default_frontend"] = frontend
149+
cfg["frontend default_port_80"] = frontend
150+
151+
if ssl_bind_string:
152+
ssl_frontend = [("bind :443 %s %s" % (ssl_bind_string, EXTRA_BIND_SETTINGS.get('443', ""))).strip(),
153+
"reqadd X-Forwarded-Proto:\ https", "maxconn %s" % MAXCONN]
154+
155+
if MONITOR_URI and (MONITOR_PORT == '443'):
156+
ssl_frontend.append("monitor-uri %s" % MONITOR_URI)
157+
monitor_uri_configured = True
158+
159+
if "443" in EXTRA_FRONTEND_SETTINGS:
160+
ssl_frontend.extend(EXTRA_FRONTEND_SETTINGS["443"])
161+
162+
ssl_frontend.append("default_backend default_service")
163+
cfg["frontend default_port_443"] = ssl_frontend
140164

141165
return cfg, monitor_uri_configured
142166

haproxy/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
from haproxycfg import run_haproxy
1414
from utils import save_to_file
1515

16+
17+
from gevent import monkey
18+
monkey.patch_all()
19+
1620
dockercloud.user_agent = "dockercloud-haproxy/%s" % __version__
1721

1822
logger = logging.getLogger("haproxy")

0 commit comments

Comments
 (0)