hestiacp/nginx/misskey.stpl

53 lines
1.8 KiB
Text
Raw Normal View History

2022-05-11 09:20:52 +08:00
#=======================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
#=======================================================================#
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
2023-02-06 17:24:35 +08:00
proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache1:16m max_size=1g inactive=720m use_temp_path=off;
2022-05-11 09:20:52 +08:00
server {
listen %ip%:%proxy_ssl_port% ssl http2;
2023-02-16 19:52:41 +08:00
listen [2603:c022:8007:9122::8888]:%proxy_ssl_port% ssl http2;
2022-05-11 09:20:52 +08:00
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*;
2023-02-05 11:05:59 +08:00
# Change to your upload limit
client_max_body_size 80m;
# Proxy to Node
2022-05-11 09:20:52 +08:00
location / {
2023-02-05 11:05:59 +08:00
proxy_pass http://127.0.0.1:3003;
2022-05-11 09:20:52 +08:00
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_redirect off;
2023-02-05 11:05:59 +08:00
# If it's behind another reverse proxy or CDN, remove the following.
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
2022-05-11 09:20:52 +08:00
# For WebSocket
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
2023-02-05 11:05:59 +08:00
# Cache settings
2023-02-06 17:24:35 +08:00
proxy_cache cache1;
proxy_cache_lock on;
proxy_cache_use_stale updating;
proxy_force_ranges on;
add_header X-Cache $upstream_cache_status;
2022-05-11 09:20:52 +08:00
}
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
}