infra/roles/mainframe/templates/01-archives.conf.j2

71 lines
2.1 KiB
Django/Jinja

server {
listen 443 ssl http2;
{% if inventory_hostname in wg_clients -%}
listen {{ wg_clients[inventory_hostname].ip }}:443 ssl http2;
{% endif -%}
include listen-proxy-protocol.conf;
server_name {{ archives_url }};
access_log /var/log/nginx/access_{{ archives_url }}.log main;
error_log /var/log/nginx/error_{{ archives_url }}.log warn;
ssl_certificate /usr/local/etc/certs/{{ archives_url }}/fullchain.pem;
ssl_certificate_key /usr/local/etc/certs/{{ archives_url }}/privkey.pem;
include /etc/nginx/authelia_internal.conf;
location /{{ podcasts }} {
autoindex on;
alias {{ archives_path }}/pub/podcasts;
# location ~* ^.+\.rss$ {
# add_header Content-Type application/rss+xml always;
# }
}
location / {
include /etc/nginx/require_auth.conf;
include /etc/nginx/require_auth_proxy.conf;
proxy_pass http://{{ bridgewithdns.archives }}:{{ archives_port }}/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}
server {
listen 443 ssl http2;
{% if inventory_hostname in wg_clients -%}
listen {{ wg_clients[inventory_hostname].ip }}:443 ssl http2;
{% endif -%}
include listen-proxy-protocol.conf;
server_name {{ archivebox_url }};
access_log /var/log/nginx/access_{{ archivebox_url }}.log main;
error_log /var/log/nginx/error_{{ archivebox_url }}.log warn;
ssl_certificate /usr/local/etc/certs/{{ archivebox_url }}/fullchain.pem;
ssl_certificate_key /usr/local/etc/certs/{{ archivebox_url }}/privkey.pem;
include /etc/nginx/authelia_internal.conf;
location / {
include /etc/nginx/require_auth.conf;
include /etc/nginx/require_auth_proxy.conf;
proxy_pass http://{{ bridgewithdns.archivebox }}:8000;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
}