From a2ad7794138e80da4b8b2a2384dc6f4e874f2f5e Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Mon, 6 May 2024 17:00:48 +0300 Subject: [PATCH] formatting --- conf.avail/http-brotli.conf | 6 ++-- conf.avail/http-gzip.conf | 6 ++-- site.avail/http-git.krd.sh.conf | 48 +++++++++++++++++++------------ site.avail/http-nexus.krd.sh.conf | 30 ++++++++++--------- 4 files changed, 53 insertions(+), 37 deletions(-) diff --git a/conf.avail/http-brotli.conf b/conf.avail/http-brotli.conf index bc7f09e..45981d4 100644 --- a/conf.avail/http-brotli.conf +++ b/conf.avail/http-brotli.conf @@ -2,9 +2,11 @@ brotli on; ## default is 6 brotli_comp_level 5; -brotli_min_length 1024; +## default is 512k +brotli_window 64k; -brotli_buffers 32 16k; +brotli_min_length 1024; +brotli_buffers 32 16k; brotli_types application/atom+xml diff --git a/conf.avail/http-gzip.conf b/conf.avail/http-gzip.conf index 57cab04..889d10b 100644 --- a/conf.avail/http-gzip.conf +++ b/conf.avail/http-gzip.conf @@ -2,14 +2,14 @@ gzip on; ## default is 1 gzip_comp_level 2; + gzip_min_length 1024; +gzip_buffers 32 16k; +gunzip_buffers 32 16k; gzip_vary on; gzip_proxied any; -gzip_buffers 32 16k; -gunzip_buffers 32 16k; - gzip_types application/atom+xml application/javascript diff --git a/site.avail/http-git.krd.sh.conf b/site.avail/http-git.krd.sh.conf index c4b203d..f15523d 100644 --- a/site.avail/http-git.krd.sh.conf +++ b/site.avail/http-git.krd.sh.conf @@ -1,3 +1,23 @@ +upstream krdsh_git { + server 127.0.0.1:3000; +} +upstream krdsh_ci { + server 127.0.0.1:8000; +} +upstream krdsh_ci_grpc { + server 127.0.0.1:9000; +} + +proxy_cache_path + /var/cache/angie/proxy/krdsh-git + keys_zone=krdsh_cache_git:10m + levels=1:2 inactive=1h; + +proxy_cache_path + /var/cache/angie/proxy/krdsh-ci + keys_zone=krdsh_cache_ci:10m + levels=1:2 inactive=1h; + server { server_name git.krd.sh ci.krd.sh; @@ -20,11 +40,6 @@ server { } } -proxy_cache_path - /var/cache/angie/proxy/krdsh-git - keys_zone=krdsh_git:10m - levels=1:2 inactive=1h; - server { server_name git.krd.sh; @@ -46,16 +61,16 @@ server { proxy_redirect ~*^http://(ci|git)\.krd\.sh(?:|:[0-9]+)/(.*)$ https://$1.krd.sh/$2; location / { - proxy_pass http://127.0.0.1:3000; + proxy_pass http://krdsh_git; ## quirks client_max_body_size 512M; chunked_transfer_encoding off; } location @precache { - proxy_pass http://127.0.0.1:3000; + proxy_pass http://krdsh_git; - proxy_cache krdsh_git; + proxy_cache krdsh_cache_git; proxy_cache_key $uri; proxy_cache_valid 200 1h; proxy_cache_valid 30s; @@ -74,15 +89,10 @@ server { location /assets/ { try_files /.non-existent-uri @precache; - # proxy_pass http://127.0.0.1:3000; + # proxy_pass http://krdsh_git; } } -proxy_cache_path - /var/cache/angie/proxy/krdsh-ci - keys_zone=krdsh_ci:10m - levels=1:2 inactive=1h; - server { server_name ci.krd.sh; @@ -104,7 +114,7 @@ server { proxy_redirect ~*^http://(ci|git)\.krd\.sh(?:|:[0-9]+)/(.*)$ https://$1.krd.sh/$2; location / { - proxy_pass http://127.0.0.1:8000; + proxy_pass http://krdsh_ci; ## quirks chunked_transfer_encoding off; client_max_body_size 16M; @@ -112,9 +122,9 @@ server { } location @precache { - proxy_pass http://127.0.0.1:8000; + proxy_pass http://krdsh_ci; - proxy_cache krdsh_ci; + proxy_cache krdsh_cache_ci; proxy_cache_key $uri; proxy_cache_valid 200 1h; proxy_cache_valid 30s; @@ -133,7 +143,7 @@ server { location /assets/ { try_files /.non-existent-uri @precache; - # proxy_pass http://127.0.0.1:8000; + # proxy_pass http://krdsh_ci; } } @@ -153,6 +163,6 @@ server { include snip.d/grpc-accept-encoding; location / { - grpc_pass grpc://127.0.0.1:9000; + grpc_pass grpc://krdsh_ci_grpc; } } diff --git a/site.avail/http-nexus.krd.sh.conf b/site.avail/http-nexus.krd.sh.conf index 701db3a..3e7d945 100644 --- a/site.avail/http-nexus.krd.sh.conf +++ b/site.avail/http-nexus.krd.sh.conf @@ -1,3 +1,12 @@ +upstream krdsh_nexus { + server 127.0.0.1:8081; +} + +proxy_cache_path + /var/cache/angie/proxy/krdsh-nexus + keys_zone=krdsh_cache_nexus:10m + levels=1:2 inactive=1h; + server { server_name nexus.krd.sh; @@ -28,7 +37,7 @@ server { gzip off; brotli off; - proxy_pass http://127.0.0.1:8081; + proxy_pass http://krdsh_nexus; proxy_method GET; } @@ -41,7 +50,7 @@ server { allow 240.0.0.0/4; deny all; - proxy_pass http://127.0.0.1:8081; + proxy_pass http://krdsh_nexus; proxy_method GET; } @@ -70,7 +79,7 @@ server { proxy_redirect ~*^http://$host(?:|:[0-9]+)/(.*)$ https://$host/$1; location / { - proxy_pass http://127.0.0.1:8081; + proxy_pass http://krdsh_nexus; ## quirks client_max_body_size 1024M; } @@ -84,7 +93,7 @@ server { allow 240.0.0.0/4; deny all; - proxy_pass http://127.0.0.1:8081; + proxy_pass http://krdsh_nexus; } ## quirks @@ -112,7 +121,7 @@ server { proxy_redirect ~*^http://$host(?:|:[0-9]+)/(.*)$ https://$host/$1; location / { - proxy_pass http://127.0.0.1:8081; + proxy_pass http://krdsh_nexus; ## quirks client_max_body_size 1024M; } @@ -126,7 +135,7 @@ server { allow 240.0.0.0/4; deny all; - proxy_pass http://127.0.0.1:8081; + proxy_pass http://krdsh_nexus; } js_import njs/nexus.js; @@ -139,11 +148,6 @@ server { chunked_transfer_encoding off; } -proxy_cache_path - /var/cache/angie/proxy/krdsh-nexus - keys_zone=krdsh_nexus:10m - levels=1:2 inactive=1h; - server { ## PITA server_name @@ -196,9 +200,9 @@ server { } location @precache { - proxy_pass http://127.0.0.1:8081; + proxy_pass http://krdsh_nexus; - proxy_cache krdsh_nexus; + proxy_cache krdsh_cache_nexus; proxy_cache_key $uri$is_args$args; proxy_cache_valid 200 1h; proxy_cache_valid 30s;