mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-06 05:41:35 +01:00
feat: move listen 443 to strem to enable true ssl passthrough
This commit is contained in:
20
nginx.py
20
nginx.py
@@ -26,6 +26,26 @@ def dump_config(vmList, masterAddress):
|
||||
[ f.write(c) for c in vmo.dumpIptables(remove=True)]
|
||||
|
||||
with open("/etc/nginx/stream_include.conf", "w") as f:
|
||||
|
||||
# ssl passthrough/no-terminate #
|
||||
ssl_passthrough_map = []
|
||||
for vmo in vmList:
|
||||
relevant_subdomains = filter(lambda x: x.get("no-terminate-ssl"), vmo.subdomains)
|
||||
for s in relevant_subdomains:
|
||||
print(s)
|
||||
# build the map contents #
|
||||
if s.get("include-subdomains"):
|
||||
match = "~.*{}".format(s.get("name"))
|
||||
else:
|
||||
match = s.get("name")
|
||||
|
||||
ssl_passthrough_map.append("{} {}:443;".format(match, vmo.ip))
|
||||
|
||||
environment = jinja2.Environment(loader=jinja2.FileSystemLoader(searchpath="./templates"))
|
||||
template = environment.get_template("nginx_stream_ssl_map.conf.j2")
|
||||
f.write(template.render(ssl_passthrough_map=ssl_passthrough_map))
|
||||
|
||||
|
||||
for vmo in vmList:
|
||||
[ f.write(c) for c in vmo.dumpStreamComponents()]
|
||||
for vmo in set(vmList):
|
||||
|
||||
Reference in New Issue
Block a user