Add examples and fix minor issues
This commit is contained in:
parent
c6bef882ca
commit
73ced05228
4 changed files with 56 additions and 12 deletions
|
|
@ -16,9 +16,7 @@ if os.getenv("HAPROXY_PASSWORD"):
|
||||||
"port": os.getenv("HAPROXY_STATS_PORT") if os.getenv("HAPROXY_STATS_PORT") else "1936",
|
"port": os.getenv("HAPROXY_STATS_PORT") if os.getenv("HAPROXY_STATS_PORT") else "1936",
|
||||||
}
|
}
|
||||||
|
|
||||||
result["metadata"] = {
|
result["lookup_label"] = os.getenv("LOOKUP_LABEL") if os.getenv("LOOKUP_LABEL") else "easyhaproxy"
|
||||||
"lookup_label": os.getenv("LOOKUP_LABEL") if os.getenv("LOOKUP_LABEL") else "easyhaproxy",
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg = HaproxyConfigGenerator(result)
|
cfg = HaproxyConfigGenerator(result)
|
||||||
print(cfg.generate(lineList))
|
print(cfg.generate(lineList))
|
||||||
|
|
|
||||||
39
examples/docker/docker-compose-changed-label.yml
Normal file
39
examples/docker/docker-compose-changed-label.yml
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +1,17 @@
|
||||||
|
# curl -H Host:www.helloworld.com localhost:19901
|
||||||
|
# f6d8d45b7411
|
||||||
|
# 59b213cb8592
|
||||||
|
|
||||||
|
# curl -I -H Host:google.helloworld.com localhost:19901
|
||||||
|
# HTTP/1.1 301 Moved Permanently
|
||||||
|
# content-length: 0
|
||||||
|
# location: www.google.com/
|
||||||
|
|
||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
haproxy:
|
haproxy:
|
||||||
image: 0x0400/easy-haproxy
|
image: byjg/easy-haproxy
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -28,11 +37,3 @@ services:
|
||||||
easyhaproxy.port.http: 19901
|
easyhaproxy.port.http: 19901
|
||||||
easyhaproxy.localport.http: 80
|
easyhaproxy.localport.http: 80
|
||||||
|
|
||||||
# curl -H Host:www.helloworld.com localhost:19901
|
|
||||||
# f6d8d45b7411
|
|
||||||
# 59b213cb8592
|
|
||||||
|
|
||||||
# curl -I -H Host:google.helloworld.com localhost:19901
|
|
||||||
# HTTP/1.1 301 Moved Permanently
|
|
||||||
# content-length: 0
|
|
||||||
# location: www.google.com/
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
# To test:
|
||||||
|
# curl -k -H "Host: host1.local" https://127.0.0.1/
|
||||||
|
#
|
||||||
|
# or add to /etc/hosts
|
||||||
|
# 127.0.0.1 host1.local
|
||||||
|
|
||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue