From f84b67e2c4063b3254b93b9d5d47f9a03db57265 Mon Sep 17 00:00:00 2001 From: lashman Date: Fri, 13 Nov 2026 01:31:48 +0200 Subject: [PATCH] nginx container for render --- Dockerfile | 6 ++++++ nginx.render.conf | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 Dockerfile create mode 100644 nginx.render.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ba057ad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM nginx:1.27-bookworm + +# render ssh needs ~/.ssh for the running user and an unlocked root +RUN mkdir -p /root/.ssh && chmod 0700 /root/.ssh && usermod --unlock root + +COPY nginx.render.conf /etc/nginx/conf.d/default.conf diff --git a/nginx.render.conf b/nginx.render.conf new file mode 100644 index 0000000..1e12cd1 --- /dev/null +++ b/nginx.render.conf @@ -0,0 +1,47 @@ +server { + listen 10000; + server_name _; + + root /usr/share/nginx/html; + index index.html; + charset utf-8; + + # answers before the mirror is uploaded, so the first deploy goes green + location = /healthz { + access_log off; + return 200 "ok\n"; + } + + location = /shop { + return 301 /shop/; + } + location = /shop/ { + return 301 /_sites/shop.uvsgames.com/; + } + location = /play { + return 301 /play/; + } + location = /play/ { + return 301 /_sites/play.uvsgames.com/; + } + + location /_sites/ { + try_files $uri $uri/ =404; + } + + # logo and page edits should not sit behind browser cache + location ~* \.svg$ { + add_header Cache-Control "no-cache"; + try_files $uri =404; + } + location ~* \.(?:html|css)$ { + add_header Cache-Control "no-cache"; + try_files $uri =404; + } + + location / { + try_files $uri $uri/ =404; + } + + error_page 404 /404.html; +}