From 70359916b97b1805e809fe85c2734414048c4c13 Mon Sep 17 00:00:00 2001 From: Arseni Date: Wed, 25 Feb 2026 23:49:18 +0300 Subject: [PATCH 1/2] fixed caddyfile --- ci/prod/compose/frontend.dockerfile | 2 +- frontend/pweb/caddy/Caddyfile | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ci/prod/compose/frontend.dockerfile b/ci/prod/compose/frontend.dockerfile index 91ebe084..c7e41b2d 100644 --- a/ci/prod/compose/frontend.dockerfile +++ b/ci/prod/compose/frontend.dockerfile @@ -45,7 +45,7 @@ WORKDIR /usr/share/pweb COPY frontend/pweb/entrypoint.sh /entrypoint.sh COPY frontend/pweb/caddy/Caddyfile /etc/caddy/Caddyfile COPY --from=web_builder /home/flutteruser/app/pweb/build/web /usr/share/pweb -COPY interface /usr/share/pweb/docs +COPY interface /usr/share/docs RUN chmod +x /entrypoint.sh diff --git a/frontend/pweb/caddy/Caddyfile b/frontend/pweb/caddy/Caddyfile index c1fc8759..96b5537e 100644 --- a/frontend/pweb/caddy/Caddyfile +++ b/frontend/pweb/caddy/Caddyfile @@ -72,6 +72,30 @@ respond "forbidden" 403 } + ######################################## + # API docs (ReDoc) + ######################################## + handle /docs { + redir * /docs/ 308 + } + + handle /docs/ { + root * {vars.static_root}/docs + rewrite * /doc.html + file_server + header Cache-Control "no-cache, no-store, must-revalidate" + header Pragma "no-cache" + header Expires "0" + } + + handle_path /docs/* { + root * {vars.static_root}/docs + file_server + header Cache-Control "no-cache, no-store, must-revalidate" + header Pragma "no-cache" + header Expires "0" + } + ######################################## # Static assets with tailored caching ######################################## -- 2.49.1 From d05a5430f1c494b512f1be412d43cb3d24079115 Mon Sep 17 00:00:00 2001 From: Arseni Date: Wed, 25 Feb 2026 23:58:02 +0300 Subject: [PATCH 2/2] final fix --- frontend/pweb/caddy/Caddyfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/pweb/caddy/Caddyfile b/frontend/pweb/caddy/Caddyfile index 96b5537e..304d82c3 100644 --- a/frontend/pweb/caddy/Caddyfile +++ b/frontend/pweb/caddy/Caddyfile @@ -12,6 +12,7 @@ ######################################## (sendico_site) { vars static_root /usr/share/pweb + vars docs_root /usr/share/docs encode zstd gzip @@ -80,7 +81,7 @@ } handle /docs/ { - root * {vars.static_root}/docs + root * {vars.docs_root} rewrite * /doc.html file_server header Cache-Control "no-cache, no-store, must-revalidate" @@ -89,7 +90,7 @@ } handle_path /docs/* { - root * {vars.static_root}/docs + root * {vars.docs_root} file_server header Cache-Control "no-cache, no-store, must-revalidate" header Pragma "no-cache" -- 2.49.1