hestiacp/nginx/matrix.stpl
2022-12-20 11:59:53 +08:00

45 lines
2.1 KiB
Text

#=======================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
#=======================================================================#
server {
listen %ip%:%proxy_ssl_port% ssl http2;
listen 8448 ssl default_server;
server_name %domain_idn% %alias_idn%;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
ssl_stapling on;
ssl_stapling_verify on;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
root %sdocroot%;
# Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
location /.well-known/matrix/client {
return 200 '{"m.homeserver": {"base_url": "https://im.kernel.ws"}}';
default_type application/json;
add_header Access-Control-Allow-Origin *;
}
location ~* ^(\/_matrix|\/_synapse) {
proxy_pass http://127.0.1.1:8008;
proxy_set_header X-Forwarded-For $remote_addr;
# Nginx by default only allows file uploads up to 1M in size
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
}
location /admin/ {
proxy_pass http://127.0.1.1:8100/;
proxy_set_header X-Forwarded-For $remote_addr;
}
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
}