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

Commit 57d6c88

Browse files
committed
fixed param order
1 parent 468306c commit 57d6c88

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Settings in this part is immutable, you have to redeploy HAProxy service to make
170170

171171
|Environment Variable|Default|Description|
172172
|:-----:|:-----:|:----------|
173-
|ADDITIONAL_BACKENDS| |list of additional backends to balance. The format is `backend name, server name ,FORCE_SSL(True|False),host:port,options`|
173+
|ADDITIONAL_BACKENDS| |list of additional backends to balance. The format is `backend name, FORCE_SSL(True|False), server name, host:port, options`|
174174
|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 resolvable and accessible to this containers.|
175175
|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)|
176176
|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`|

haproxy/config.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@ def parse_extra_frontend_settings(envvars):
2828
settings_dict[port] = settings
2929
return settings_dict
3030

31-
# backend_name,server_name,settings,host:port
31+
# backend_name,FORCE_SSL,server_name,host:port, options
3232
def parse_additional_backends(additional_backend_settings):
3333
additional_backends = {}
3434
if not additional_backend_settings:
3535
return additional_backends
36+
3637
for backend in additional_backend_settings.split(";"):
3738
parts = backend.split(",")
38-
service_name, backend_name, redirect, backend_desc,options = parts
39+
backend_name, force_ssl, server_name, host_port, options = parts
3940

40-
if redirect=="True":
41-
route = ["redirect scheme https code 301 if !{ ssl_fc }", backend_name + ' ' + backend_desc + ' ' + options]
41+
if force_ssl=="True":
42+
route = ["redirect scheme https code 301 if !{ ssl_fc }", 'server ' + server_name + ' ' + host_port + ' ' + options]
4243
else:
43-
route = [backend_name + ' ' + backend_desc + ' ' + options]
44+
route = ['server ' + server_name + ' ' + host_port + ' ' + options]
4445

45-
additional_backends[service_name] = route
46+
additional_backends[backend_name] = route
4647
return additional_backends
4748

4849
# envvar

0 commit comments

Comments
 (0)