snikket/http.template.tmpl

48 lines
1.3 KiB
Cheetah

# fork of https://github.com/decentral1se/snikket-web-proxy/blob/main/nginx/http.template
# changes from https://github.com/3-w-c/snikket-web-proxy/blob/bcec18a66f5a61aace1d2a646afda5bbf2de9b79/nginx/http.template
# until https://github.com/snikket-im/snikket-server/issues/88 is resolved
server {
listen ${SNIKKET_TWEAK_HTTP_PORT};
listen [::]:${SNIKKET_TWEAK_HTTP_PORT};
server_name ${SNIKKET_DOMAIN};
server_name groups.${SNIKKET_DOMAIN};
include "/etc/nginx/snippets/snikket-common.conf";
}
server {
listen ${SNIKKET_TWEAK_HTTP_PORT};
listen [::]:${SNIKKET_TWEAK_HTTP_PORT};
server_name share.${SNIKKET_DOMAIN};
root /var/www/html;
location /upload/ {
client_max_body_size 16M;
proxy_pass http://${SNIKKET_TWEAK_INTERNAL_HTTP_HOST}:${SNIKKET_TWEAK_INTERNAL_HTTP_PORT};
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
# Fail requests to unknown domains
server {
listen ${SNIKKET_TWEAK_HTTP_PORT};
listen [::]:${SNIKKET_TWEAK_HTTP_PORT};
error_page 404 /_errors/404_site.html;
location = /_errors/404_site.html {
root /var/www/html;
internal;
}
location / {
try_files none =404;
}
}