feat: add cdn

This commit is contained in:
Strix 2023-10-26 14:30:28 +02:00
parent fd603305d8
commit 08d731adc2
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
3 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,35 @@
server {
listen 80;
server_name cdn.ixvd.net;
proxy_cache cache;
proxy_cache_valid 200 30m;
proxy_cache_valid 404 1m;
proxy_buffering on;
proxy_ignore_headers Expires;
proxy_ignore_headers X-Accel-Expires;
proxy_ignore_headers Cache-Control;
proxy_ignore_headers Set-Cookie;
proxy_hide_header X-Accel-Expires;
proxy_hide_header Expires;
proxy_hide_header Cache-Control;
proxy_hide_header Pragma;
proxy_intercept_errors on;
proxy_redirect off;
location @404 {
return 404;
}
location / {
root /usr/share/nginx/html;
}
location ~ /assets(.*) {
proxy_pass https://git.ixvd.net/ixvd/assets/raw/branch/main$1;
}
}

View file

@ -31,5 +31,7 @@ http {
#gzip on; #gzip on;
proxy_cache_path /tmp/cache keys_zone=cache:1h;
include /etc/nginx/conf.d/*.conf; include /etc/nginx/conf.d/*.conf;
} }

View file

@ -7,7 +7,7 @@ services:
build: custom/nginx build: custom/nginx
environment: environment:
CERTBOT_EMAIL: "webmaster@ixvd.net" CERTBOT_EMAIL: "webmaster@ixvd.net"
CERTBOT_DOMAINS: "keymaker.ixvd.net" CERTBOT_DOMAINS: "keymaker.ixvd.net,ixvd.net,via.ixvd.net,cdn.ixvd.net"
volumes: volumes:
- /srv/certbot/data:/etc/letsencrypt - /srv/certbot/data:/etc/letsencrypt
- /srv/certbot/other/www:/var/www/certbot - /srv/certbot/other/www:/var/www/certbot