Commit ba22f409 authored by Nico's avatar Nico
Browse files

revproxy: add redirect support

parent 8e17d127
......@@ -4,6 +4,6 @@ letsencrypt_acme_directory: "https://acme-v02.api.letsencrypt.org/directory"
vhosts:
- domain: grafana.freifunk-stuttgart.de
backend: http://10.0.3.237/
type: https
type: proxy
enabled: true
......@@ -27,6 +27,7 @@ server {
}
location / {
{% if vhost.type == "proxy" %}
proxy_pass {{ vhost.backend }};
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $ip_anonymized;
......@@ -39,6 +40,9 @@ server {
proxy_pass_header Authorization;
proxy_read_timeout 600s;
proxy_request_buffering off;
{% elif vhost.type == "redirect" %}
return 301 {{ vhost.redirect }}$request_uri;
{% endif %}
}
}
......@@ -47,7 +51,11 @@ server {
server_name {{ vhost.domain}};
location / {
{% if vhost.type == "proxy" %}
return 301 https://{{ vhost.domain }}$request_uri;
{% elif vhost.type == "redirect" %}
return 301 {{ vhost.redirect }}$request_uri;
{% endif %}
}
# lets encrypt challenges
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment