feat: generate a default vhost for smart proxy instances

This commit is contained in:
Iain Learmonth 2025-02-02 19:36:34 +00:00
parent 861f5fb553
commit 1797c4a826

View file

@ -120,6 +120,17 @@ class ProxyAutomation(TerraformAutomation):
self.tmpl_write(
f"smart_proxy.{group.id}.conf",
"""
server {
listen 443 ssl default_server;
server_name www.{{ group.group_name | lower }}.smart.{{ smart_zone[:-1] }};
location / {
add_header Content-Type text/html;
return 200 "<html></html>";
}
ssl_certificate /etc/ssl/smart_proxy.crt;
ssl_certificate_key /etc/ssl/private/smart_proxy.key;
}
{% for origin in origins %}
server {
listen 443 ssl;
@ -180,6 +191,7 @@ class ProxyAutomation(TerraformAutomation):
{% endfor %}
""",
provider=self.provider,
group=group,
origins=group_origins,
smart_zone=app.config["SMART_ZONE"],
)