From 5370346a89fb7256e5196943688199c91bb09d99 Mon Sep 17 00:00:00 2001 From: vladtechno Date: Sat, 16 May 2026 22:18:36 +1000 Subject: [PATCH] feat(ops): Caddy fragment for mechanic.pptaxi.ru --- ops/Caddyfile.fragment | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ops/Caddyfile.fragment diff --git a/ops/Caddyfile.fragment b/ops/Caddyfile.fragment new file mode 100644 index 0000000..f5e04ae --- /dev/null +++ b/ops/Caddyfile.fragment @@ -0,0 +1,39 @@ +# Caddy fragment for Premium Mechanic PWA on mechanic.pptaxi.ru. +# Apply on VDS 100.64.0.12 by copying/including into /etc/caddy/Caddyfile +# (or /etc/caddy/sites-enabled/ if the main Caddyfile uses imports). +# +# Assumes: +# - TaxiDashboard backend listens on 127.0.0.1:8000 +# - Frontend PWA build is rsynced to /opt/sites/mechanic-pwa/dist/ + +mechanic.pptaxi.ru { + encode gzip zstd + + # PWA: pass /api/* to the backend so the frontend can use relative URLs. + handle /api/* { + reverse_proxy 127.0.0.1:8000 + } + + # PWA static files with SPA fallback to index.html. + handle { + root * /opt/sites/mechanic-pwa/dist + try_files {path} /index.html + file_server + } + + log { + output file /var/log/caddy/mechanic.pptaxi.ru.log { + roll_size 50mb + roll_keep 5 + } + } + + header { + # Basic security headers for a PWA + Referrer-Policy strict-origin-when-cross-origin + X-Content-Type-Options nosniff + X-Frame-Options DENY + # Camera permission for our origin only + Permissions-Policy "camera=(self), microphone=(self), geolocation=()" + } +}