1
0

formatting

This commit is contained in:
Konstantin Demin 2024-05-06 17:00:48 +03:00
parent 324dded6d2
commit a2ad779413
Signed by: krd
GPG Key ID: 1F33CB0BA4731BC6
4 changed files with 53 additions and 37 deletions

View File

@ -2,8 +2,10 @@ brotli on;
## default is 6 ## default is 6
brotli_comp_level 5; brotli_comp_level 5;
brotli_min_length 1024; ## default is 512k
brotli_window 64k;
brotli_min_length 1024;
brotli_buffers 32 16k; brotli_buffers 32 16k;
brotli_types brotli_types

View File

@ -2,14 +2,14 @@ gzip on;
## default is 1 ## default is 1
gzip_comp_level 2; gzip_comp_level 2;
gzip_min_length 1024; gzip_min_length 1024;
gzip_buffers 32 16k;
gunzip_buffers 32 16k;
gzip_vary on; gzip_vary on;
gzip_proxied any; gzip_proxied any;
gzip_buffers 32 16k;
gunzip_buffers 32 16k;
gzip_types gzip_types
application/atom+xml application/atom+xml
application/javascript application/javascript

View File

@ -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 {
server_name git.krd.sh ci.krd.sh; 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 {
server_name git.krd.sh; server_name git.krd.sh;
@ -46,16 +61,16 @@ server {
proxy_redirect ~*^http://(ci|git)\.krd\.sh(?:|:[0-9]+)/(.*)$ https://$1.krd.sh/$2; proxy_redirect ~*^http://(ci|git)\.krd\.sh(?:|:[0-9]+)/(.*)$ https://$1.krd.sh/$2;
location / { location / {
proxy_pass http://127.0.0.1:3000; proxy_pass http://krdsh_git;
## quirks ## quirks
client_max_body_size 512M; client_max_body_size 512M;
chunked_transfer_encoding off; chunked_transfer_encoding off;
} }
location @precache { 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_key $uri;
proxy_cache_valid 200 1h; proxy_cache_valid 200 1h;
proxy_cache_valid 30s; proxy_cache_valid 30s;
@ -74,15 +89,10 @@ server {
location /assets/ { location /assets/ {
try_files /.non-existent-uri @precache; 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 {
server_name ci.krd.sh; server_name ci.krd.sh;
@ -104,7 +114,7 @@ server {
proxy_redirect ~*^http://(ci|git)\.krd\.sh(?:|:[0-9]+)/(.*)$ https://$1.krd.sh/$2; proxy_redirect ~*^http://(ci|git)\.krd\.sh(?:|:[0-9]+)/(.*)$ https://$1.krd.sh/$2;
location / { location / {
proxy_pass http://127.0.0.1:8000; proxy_pass http://krdsh_ci;
## quirks ## quirks
chunked_transfer_encoding off; chunked_transfer_encoding off;
client_max_body_size 16M; client_max_body_size 16M;
@ -112,9 +122,9 @@ server {
} }
location @precache { 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_key $uri;
proxy_cache_valid 200 1h; proxy_cache_valid 200 1h;
proxy_cache_valid 30s; proxy_cache_valid 30s;
@ -133,7 +143,7 @@ server {
location /assets/ { location /assets/ {
try_files /.non-existent-uri @precache; 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; include snip.d/grpc-accept-encoding;
location / { location / {
grpc_pass grpc://127.0.0.1:9000; grpc_pass grpc://krdsh_ci_grpc;
} }
} }

View File

@ -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 {
server_name nexus.krd.sh; server_name nexus.krd.sh;
@ -28,7 +37,7 @@ server {
gzip off; gzip off;
brotli off; brotli off;
proxy_pass http://127.0.0.1:8081; proxy_pass http://krdsh_nexus;
proxy_method GET; proxy_method GET;
} }
@ -41,7 +50,7 @@ server {
allow 240.0.0.0/4; allow 240.0.0.0/4;
deny all; deny all;
proxy_pass http://127.0.0.1:8081; proxy_pass http://krdsh_nexus;
proxy_method GET; proxy_method GET;
} }
@ -70,7 +79,7 @@ server {
proxy_redirect ~*^http://$host(?:|:[0-9]+)/(.*)$ https://$host/$1; proxy_redirect ~*^http://$host(?:|:[0-9]+)/(.*)$ https://$host/$1;
location / { location / {
proxy_pass http://127.0.0.1:8081; proxy_pass http://krdsh_nexus;
## quirks ## quirks
client_max_body_size 1024M; client_max_body_size 1024M;
} }
@ -84,7 +93,7 @@ server {
allow 240.0.0.0/4; allow 240.0.0.0/4;
deny all; deny all;
proxy_pass http://127.0.0.1:8081; proxy_pass http://krdsh_nexus;
} }
## quirks ## quirks
@ -112,7 +121,7 @@ server {
proxy_redirect ~*^http://$host(?:|:[0-9]+)/(.*)$ https://$host/$1; proxy_redirect ~*^http://$host(?:|:[0-9]+)/(.*)$ https://$host/$1;
location / { location / {
proxy_pass http://127.0.0.1:8081; proxy_pass http://krdsh_nexus;
## quirks ## quirks
client_max_body_size 1024M; client_max_body_size 1024M;
} }
@ -126,7 +135,7 @@ server {
allow 240.0.0.0/4; allow 240.0.0.0/4;
deny all; deny all;
proxy_pass http://127.0.0.1:8081; proxy_pass http://krdsh_nexus;
} }
js_import njs/nexus.js; js_import njs/nexus.js;
@ -139,11 +148,6 @@ server {
chunked_transfer_encoding off; chunked_transfer_encoding off;
} }
proxy_cache_path
/var/cache/angie/proxy/krdsh-nexus
keys_zone=krdsh_nexus:10m
levels=1:2 inactive=1h;
server { server {
## PITA ## PITA
server_name server_name
@ -196,9 +200,9 @@ server {
} }
location @precache { 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_key $uri$is_args$args;
proxy_cache_valid 200 1h; proxy_cache_valid 200 1h;
proxy_cache_valid 30s; proxy_cache_valid 30s;