diff options
author | Matthew Fennell <matthew@fennell.dev> | 2024-04-04 22:54:05 +0100 |
---|---|---|
committer | Matthew Fennell <matthew@fennell.dev> | 2024-04-04 22:54:05 +0100 |
commit | de867dadbcc3c69d97acf96bf3e86d11295eea39 (patch) | |
tree | 2962ef65772790097581f19a2af9b12ac30087e4 /files/nginx_conf.j2 | |
parent | d29a60b1afec942fe4f7ca7baa95d870afaae83e (diff) |
Bring repo up-to-date with current prod config
Diffstat (limited to 'files/nginx_conf.j2')
-rw-r--r-- | files/nginx_conf.j2 | 31 |
1 files changed, 31 insertions, 0 deletions
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 <matthew@fennell.dev> +# +# 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; +} |