fix playmat host and image throttling

This commit is contained in:
Alex
2026-11-20 15:15:06 -07:00
parent 73d88c4ac3
commit bfbf99d54f
4 changed files with 20 additions and 5 deletions
+4
View File
@@ -62,6 +62,7 @@ data:
}
location = /img/api/cards/collection {
limit_except POST { deny all; }
limit_req zone=scryfall_upstream burst=${IMGCACHE_API_BURST};
set $api_upstream api.scryfall.com;
proxy_pass https://$api_upstream/cards/collection;
proxy_set_header Host $api_upstream;
@@ -72,10 +73,12 @@ data:
proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
proxy_cache scryfall_api;
proxy_cache_methods GET HEAD POST;
proxy_cache_lock on;
proxy_cache_key "$request_method$request_uri$request_body";
proxy_cache_valid 200 24h;
}
location /img/api/ {
limit_req zone=scryfall_upstream burst=${IMGCACHE_API_BURST};
set $api_upstream api.scryfall.com;
proxy_pass https://$api_upstream/;
proxy_set_header Host $api_upstream;
@@ -87,6 +90,7 @@ data:
proxy_redirect https://cards.scryfall.io/ /img/cards/;
proxy_redirect https://backs.scryfall.io/ /img/backs/;
proxy_cache scryfall_api;
proxy_cache_lock on;
proxy_cache_key $request_uri;
proxy_cache_valid 200 301 302 24h;
}
+11
View File
@@ -9,6 +9,16 @@ metadata:
spec:
ingressClassName: traefik
rules:
- host: mtg.aleshym.co
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
name: http
- host: playmat.aleshym.co
http:
paths:
@@ -21,5 +31,6 @@ spec:
name: http
tls:
- hosts:
- mtg.aleshym.co
- playmat.aleshym.co
secretName: playmat-tls
+3 -3
View File
@@ -26,7 +26,7 @@ spec:
containerPort: 80
env:
- name: DOMAIN
value: playmat.aleshym.co
value: mtg.aleshym.co
- name: TLS_MODE
value: external
- name: UPSTREAM_PROXIES
@@ -34,9 +34,9 @@ spec:
- name: XMAGE_GATEWAY
value: off
- name: XMAGE_ALLOWED_ORIGINS
value: https://playmat.aleshym.co
value: https://mtg.aleshym.co,https://playmat.aleshym.co
- name: XMAGE_PUBLIC_URL
value: https://playmat.aleshym.co
value: https://mtg.aleshym.co
- name: CADDY_IP
value: 127.0.0.1
readinessProbe:
+2 -2
View File
@@ -41,9 +41,9 @@ spec:
containerPort: 17173
env:
- name: XMAGE_ALLOWED_ORIGINS
value: https://playmat.aleshym.co
value: https://mtg.aleshym.co,https://playmat.aleshym.co
- name: XMAGE_PUBLIC_URL
value: https://playmat.aleshym.co
value: https://mtg.aleshym.co
- name: XMAGE_SERVER_NAME
value: playmat
- name: XMAGE_TRUSTED_PROXIES