Skip to content
Snippets Groups Projects
Unverified Commit b761fd1f authored by Nico's avatar Nico
Browse files

add support for listening on port 8080

parent fa2ce5f2
No related branches found
No related tags found
No related merge requests found
---
letsencrypt_account_email: "hostmaster@freifunk-stuttgart.de"
letsencrypt_acme_directory: "https://acme-v02.api.letsencrypt.org/directory"
revproxy_http_ports:
- 80
- 8080
vhosts:
- domain: grafana.freifunk-stuttgart.de
backend: "http://10.0.3.237/"
......@@ -86,3 +89,8 @@ vhosts:
backend: "http://10.0.3.164/"
type: proxy
max_body_size: 2G
- domain: unifi.freifunk-stuttgart.de
backend: "http://10.0.3.222:8080/"
type: proxy
force_https: False
http_port: 8080
server {
listen [::]:80 ipv6only=off;
{% for port in revproxy_http_ports|default([80]) %}
listen [::]:{{port}} ipv6only=off;
{% endfor %}
listen [::]:443 ssl default_server ipv6only=off;
server_name _;
......
location / {
{% if vhost.maintenance is defined and vhost.maintenance.enabled -%}
if ($maintenance_{{ vhost.domain | sha1 }}) {
return 503 "{{ vhost.maintenance.message }}";
add_header Content-Type text/plain always;
}
{% endif %}
{% if vhost.type == "proxy" %}
{% include 'vhost-proxy.conf' %}
{% elif vhost.type == "redirect" %}
{% include 'vhost-redirect.conf' %}
{% elif vhost.type == "static" %}
{% include 'vhost-static.conf' %}
{% endif %}
}
......@@ -21,27 +21,14 @@ server {
{% include 'vhost-serve-letsencrypt.conf' %}
location / {
{% if vhost.maintenance is defined and vhost.maintenance.enabled -%}
if ($maintenance_{{ vhost.domain | sha1 }}) {
return 503 "{{ vhost.maintenance.message }}";
add_header Content-Type text/plain always;
}
{% endif %}
{% if vhost.type == "proxy" %}
{% include 'vhost-proxy.conf' %}
{% elif vhost.type == "redirect" %}
{% include 'vhost-redirect.conf' %}
{% elif vhost.type == "static" %}
{% include 'vhost-static.conf' %}
{% endif %}
}
{% include 'vhost-location.conf' %}
}
server {
listen [::]:80;
listen [::]:{{ vhost.http_port|default(80) }};
server_name {{ vhost.domain}};
{% if vhost.force_https|default(True) %}
location / {
{% if vhost.type in ["proxy", "static"] %}
return 301 https://{{ vhost.domain }}$request_uri;
......@@ -49,6 +36,9 @@ server {
return 301 {{ vhost.redirect }}$request_uri;
{% endif %}
}
{% else %}
{% include 'vhost-location.conf' %}
{% endif %}
{% include 'vhost-serve-letsencrypt.conf' %}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment