1
0
angie-krdsh/site.avail/http-git.krd.sh.conf

169 lines
3.5 KiB
Plaintext
Raw Normal View History

2024-05-06 17:00:48 +03:00
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;
2024-03-22 10:24:54 +03:00
server {
server_name git.krd.sh ci.krd.sh;
include snip.d/listen-http;
access_log off;
log_not_found off;
root /var/www/empty;
include snip.d/https-alt-svc;
include snip.d/http-security-headers;
keepalive_timeout 0;
include snip.d/empty-favicon;
location / {
return 301 https://$host$uri$is_args$args;
}
}
server {
server_name git.krd.sh;
include snip.d/listen-https;
include snip.d/ssl-krd.sh;
access_log off;
log_not_found off;
root /var/www/empty;
include snip.d/http-security-headers;
include snip.d/proxy-common-headers;
include snip.d/proxy-accept-encoding;
include snip.d/proxy-connection-keepalive;
include snip.d/proxy-early-data;
proxy_redirect ~*^http://(ci|git)\.krd\.sh(?:|:[0-9]+)/(.*)$ https://$1.krd.sh/$2;
location / {
2024-05-06 17:00:48 +03:00
proxy_pass http://krdsh_git;
2024-03-22 10:24:54 +03:00
## quirks
client_max_body_size 512M;
chunked_transfer_encoding off;
}
location @precache {
2024-05-06 17:00:48 +03:00
proxy_pass http://krdsh_git;
2024-03-22 10:24:54 +03:00
2024-05-06 17:00:48 +03:00
proxy_cache krdsh_cache_git;
2024-03-22 10:24:54 +03:00
proxy_cache_key $uri;
proxy_cache_valid 200 1h;
proxy_cache_valid 30s;
proxy_ignore_client_abort on;
proxy_ignore_headers Cache-Control;
proxy_hide_header Cache-Control;
expires 2h;
## quirks
chunked_transfer_encoding off;
proxy_method GET;
proxy_buffering on;
proxy_temp_file_write_size 4m;
}
location /assets/ {
try_files /.non-existent-uri @precache;
2024-05-06 17:00:48 +03:00
# proxy_pass http://krdsh_git;
2024-03-22 10:24:54 +03:00
}
}
server {
server_name ci.krd.sh;
include snip.d/listen-https;
include snip.d/ssl-krd.sh;
access_log off;
log_not_found off;
root /var/www/empty;
include snip.d/http-security-headers;
include snip.d/proxy-common-headers;
include snip.d/proxy-accept-encoding;
include snip.d/proxy-connection-keepalive;
include snip.d/proxy-early-data;
proxy_redirect ~*^http://(ci|git)\.krd\.sh(?:|:[0-9]+)/(.*)$ https://$1.krd.sh/$2;
location / {
2024-05-06 17:00:48 +03:00
proxy_pass http://krdsh_ci;
2024-03-22 10:24:54 +03:00
## quirks
chunked_transfer_encoding off;
client_max_body_size 16M;
proxy_buffering off;
}
location @precache {
2024-05-06 17:00:48 +03:00
proxy_pass http://krdsh_ci;
2024-03-22 10:24:54 +03:00
2024-05-06 17:00:48 +03:00
proxy_cache krdsh_cache_ci;
2024-03-22 10:24:54 +03:00
proxy_cache_key $uri;
proxy_cache_valid 200 1h;
proxy_cache_valid 30s;
proxy_ignore_client_abort on;
proxy_ignore_headers Cache-Control;
proxy_hide_header Cache-Control;
expires 2h;
## quirks
chunked_transfer_encoding off;
proxy_method GET;
proxy_buffering on;
proxy_temp_file_write_size 4m;
}
location /assets/ {
try_files /.non-existent-uri @precache;
2024-05-06 17:00:48 +03:00
# proxy_pass http://krdsh_ci;
2024-03-22 10:24:54 +03:00
}
}
server {
server_name ci.krd.sh;
include snip.d/listen-grpcs;
include snip.d/ssl-krd.sh;
access_log off;
log_not_found off;
root /var/www/empty;
include snip.d/http-security-headers;
include snip.d/grpc-accept-encoding;
location / {
2024-05-06 17:00:48 +03:00
grpc_pass grpc://krdsh_ci_grpc;
2024-03-22 10:24:54 +03:00
}
}