Skip to content
Snippets Groups Projects
Commit aea863aa authored by Adrian Reyer's avatar Adrian Reyer
Browse files

role revproxy: allow additional configuration, check...

role revproxy: allow additional configuration, check host_vars/revproxy.as208772.net/revproxy -> unifi.freifunk-stuttgart.de for an example
parent 9e27dda0
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,21 @@ vhosts:
- domain: unifi.freifunk-stuttgart.de
backend: "https://10.0.3.222:8443/"
type: proxy
additional_headers:
- name: X-Forwarded-Proto
value: https
additional_config_https_pre: []
additional_config_https_post: []
additional_config_http_pre: []
additional_config_http_post: []
additional_config_pre: []
additional_config_post:
- "server {"
- " listen 8080;"
- " location /inform {"
- " proxy_pass http://10.0.3.222:8080/inform;"
- " }"
- "}"
- domain: wiki.freifunk-stuttgart.de
redirect: "https://wiki.freifunk-stuttgart.net"
type: redirect
......
......@@ -8,6 +8,12 @@ geo $maintenance_{{ vhost.domain | sha1 }} {
{% endfor %}
}
{% endif %}
{% if vhost.additional_config_pre is defined %}
# additional_config_pre
{% for line in vhost.additional_config_pre | default([]) %}
{{ line }}
{% endfor %}
{% endif %}
server {
listen [::]:443 ssl http2;
server_name {{ vhost.domain }};
......@@ -24,6 +30,13 @@ server {
# include vhost-serve-letsencrypt.conf
{{ includewrapper('vhost-serve-letsencrypt.conf') | indent(2) }}
{% if vhost.additional_config_https_pre is defined %}
# additional_config_https_pre
{% for line in vhost.additional_config_https_pre | default([]) %}
{{ line }}
{% endfor %}
{% endif %}
location / {
{% if vhost.maintenance is defined and vhost.maintenance.enabled -%}
if ($maintenance_{{ vhost.domain | sha1 }}) {
......@@ -42,12 +55,25 @@ server {
{{ includewrapper('vhost-static.conf') | indent(4) }}
{% endif %}
}
{% if vhost.additional_config_https_post is defined %}
# additional_config_https_post
{% for line in vhost.additional_config_https_post | default([]) %}
{{ line }}
{% endfor %}
{% endif %}
}
server {
listen [::]:80;
server_name {{ vhost.domain}};
{% if vhost.additional_config_http_pre is defined %}
# additional_config_http_pre
{% for line in vhost.additional_config_http_pre | default([]) %}
{{ line }}
{% endfor %}
{% endif %}
location / {
{% if vhost.type in ["proxy", "static"] %}
return 301 https://{{ vhost.domain }}$request_uri;
......@@ -56,6 +82,19 @@ server {
{% endif %}
}
{% if vhost.additional_config_http_post is defined %}
# additional_config_http_post
{% for line in vhost.additional_config_http_post | default([]) %}
{{ line }}
{% endfor %}
{% endif %}
# include 'vhost-serve-letsencrypt.conf'
{{ includewrapper('vhost-serve-letsencrypt.conf') | indent(2) }}
}
{% if vhost.additional_config_post is defined %}
# additional_config_post
{% for line in vhost.additional_config_post | default([]) %}
{{ line }}
{% endfor %}
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment