From 47c17138e7b09f58decf17e471be3e5a39f4fcde Mon Sep 17 00:00:00 2001 From: qy117121 Date: Mon, 6 Feb 2023 17:24:35 +0800 Subject: [PATCH] update --- nginx/jiji.stpl | 47 ---------------------------------------------- nginx/jiji.tpl | 39 -------------------------------------- nginx/matrix.stpl | 8 ++++++++ nginx/misskey.stpl | 7 +++++++ 4 files changed, 15 insertions(+), 86 deletions(-) delete mode 100644 nginx/jiji.stpl delete mode 100644 nginx/jiji.tpl mode change 100644 => 100755 nginx/matrix.stpl diff --git a/nginx/jiji.stpl b/nginx/jiji.stpl deleted file mode 100644 index a5791fa..0000000 --- a/nginx/jiji.stpl +++ /dev/null @@ -1,47 +0,0 @@ -#=======================================================================# -# Default Web Domain Template # -# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS # -#=======================================================================# -map $http_upgrade $connection_upgrade { - default upgrade; - '' close; -} - -server { - listen %ip%:%proxy_ssl_port% ssl http2; - listen [::]:%proxy_ssl_port% ssl http2; - 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*; - - client_max_body_size 80m; - - location / { - proxy_pass http://127.0.0.1:3003; - proxy_set_header Host $host; - proxy_http_version 1.1; - proxy_redirect off; - - - # For WebSocket - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - - } - - - - location ~ /\.ht {return 404;} - location ~ /\.svn/ {return 404;} - location ~ /\.git/ {return 404;} - location ~ /\.hg/ {return 404;} - location ~ /\.bzr/ {return 404;} - - include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*; -} - diff --git a/nginx/jiji.tpl b/nginx/jiji.tpl deleted file mode 100644 index d657828..0000000 --- a/nginx/jiji.tpl +++ /dev/null @@ -1,39 +0,0 @@ -#=========================================================================# -# Default Web Domain Template # -# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS # -# https://docs.hestiacp.com/admin_docs/web.html#how-do-web-templates-work # -#=========================================================================# - -server { - listen %ip%:%proxy_port%; - server_name %domain_idn% %alias_idn%; - - include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*; - - location / { - proxy_pass http://%ip%:%web_port%; - location ~* ^.+\.(%proxy_extensions%)$ { - root %docroot%; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - try_files $uri @fallback; - } - } - - location /error/ { - alias %home%/%user%/web/%domain%/document_errors/; - } - - location @fallback { - proxy_pass http://%ip%:%web_port%; - } - - location ~ /\.(?!well-known\/|file) { - deny all; - return 404; - } - - include %home%/%user%/conf/web/%domain%/nginx.conf_*; -} - diff --git a/nginx/matrix.stpl b/nginx/matrix.stpl old mode 100644 new mode 100755 index dfa03ec..1b13d65 --- a/nginx/matrix.stpl +++ b/nginx/matrix.stpl @@ -24,6 +24,14 @@ server { 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 / { + proxy_pass http://127.0.0.1:6080; + 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 /.well-known/matrix/client { return 200 '{"m.homeserver": {"base_url": "https://im.kernel.ws"}}'; default_type application/json; diff --git a/nginx/misskey.stpl b/nginx/misskey.stpl index 069529d..42a9b30 100644 --- a/nginx/misskey.stpl +++ b/nginx/misskey.stpl @@ -6,6 +6,7 @@ map $http_upgrade $connection_upgrade { default upgrade; '' close; } +proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache1:16m max_size=1g inactive=720m use_temp_path=off; server { listen %ip%:%proxy_ssl_port% ssl http2; @@ -39,8 +40,14 @@ server { proxy_set_header Connection $connection_upgrade; # Cache settings + proxy_cache cache1; + proxy_cache_lock on; + proxy_cache_use_stale updating; + proxy_force_ranges on; + add_header X-Cache $upstream_cache_status; } include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*; } +