diff --git a/templates/nginx_stream_block.conf.j2 b/templates/nginx_stream_block.conf.j2 index f332f53..d81667d 100644 --- a/templates/nginx_stream_block.conf.j2 +++ b/templates/nginx_stream_block.conf.j2 @@ -13,6 +13,10 @@ server { proxy_pass {{ targetip }}:$server_port; {% endif %} + {% if extra_content %} + {{ extra_content }} + {% endif %} + {% if transparent %} proxy_bind $remote_addr:{% if targetportoverwrite %}{{ targetportoverwrite }}{% else %}$remote_port{% endif %} transparent; {% endif %} diff --git a/vm.py b/vm.py index 1db9023..96d19c9 100644 --- a/vm.py +++ b/vm.py @@ -66,6 +66,7 @@ class VM: proto = portStruct.get("proto") or "tcp" isUDP = proto == "udp" proxy_timeout = portStruct.get("proxy_timeout") or "10s" + extra_content = portStruct.get("extra-content") compositeName = "-".join((self.hostname, name, portstring, proto)) @@ -74,7 +75,7 @@ class VM: component = template.render(targetip=self.ip, udp=isUDP, portstring=portstring, transparent=transparent, proxy_timeout=proxy_timeout, - comment=compositeName) + comment=compositeName, extra_content=extra_content) components.append(component) return components