From de867dadbcc3c69d97acf96bf3e86d11295eea39 Mon Sep 17 00:00:00 2001 From: Matthew Fennell Date: Thu, 4 Apr 2024 22:54:05 +0100 Subject: Bring repo up-to-date with current prod config --- files/nginx_conf.j2 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 files/nginx_conf.j2 (limited to 'files/nginx_conf.j2') diff --git a/files/nginx_conf.j2 b/files/nginx_conf.j2 new file mode 100644 index 0000000..fbddce8 --- /dev/null +++ b/files/nginx_conf.j2 @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: 2024 Matthew Fennell +# +# SPDX-License-Identifier: AGPL-3.0-only + +server { + listen 443 ssl; + listen [::]:443; + + ssl_certificate /etc/prosody/certs/{{ virtual_host }}.crt; + ssl_certificate_key /etc/prosody/certs/{{ virtual_host }}.key; + + server_name {{ delegate_host }}; + + location / { + proxy_pass https://localhost:5281; + proxy_set_header Host "{{ delegate_host }}"; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_buffering off; + tcp_nodelay on; + } +} + +server { + listen 80; + listen [::]:80; + + server_name {{ delegate_host }}; + + return 301 https://$host$request_uri; +} -- cgit v1.2.3