mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-06 05:41:35 +01:00
feat: support for extra locations
This commit is contained in:
@@ -11,6 +11,16 @@ server{
|
|||||||
include acme-challenge.conf;
|
include acme-challenge.conf;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if extra_location %}
|
||||||
|
location {{ extra_location["location"] }} {
|
||||||
|
{{ extra_location["content"] }}
|
||||||
|
{% if extra_location["location-auth"] %}
|
||||||
|
auth_basic "{{ extra_location["location-auth"] }}";
|
||||||
|
auth_basic_user_file /etc/nginx/{{ extra_location["location-auth"] }}.htpasswd;
|
||||||
|
{% endif %}
|
||||||
|
}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://{{ targetip }}:{{ targetport }};
|
proxy_pass http://{{ targetip }}:{{ targetport }};
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
|||||||
3
vm.py
3
vm.py
@@ -132,7 +132,8 @@ class VM:
|
|||||||
component = template.render(targetip=self.ip, targetport=targetport,
|
component = template.render(targetip=self.ip, targetport=targetport,
|
||||||
servernames=[subdomain["name"]], comment=compositeName,
|
servernames=[subdomain["name"]], comment=compositeName,
|
||||||
proxy_pass_blob=self.proxy_pass_blob, acme=not self.noTerminateACME,
|
proxy_pass_blob=self.proxy_pass_blob, acme=not self.noTerminateACME,
|
||||||
basicauth=subdomain.get("basicauth"))
|
basicauth=subdomain.get("basicauth"),
|
||||||
|
extra_location=subdomain.get("extra-location"))
|
||||||
components.append(component)
|
components.append(component)
|
||||||
|
|
||||||
return components
|
return components
|
||||||
|
|||||||
Reference in New Issue
Block a user