From 091e126744e3320cdd9a344f0985f58c8671bd90 Mon Sep 17 00:00:00 2001 From: ulfrxdev Date: Mon, 23 Mar 2026 22:18:03 +0100 Subject: [PATCH] Try to fix cloudflare caches --- stacks/recipe/Dockerfile | 7 ++++--- stacks/recipe/nginx/default.conf | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 stacks/recipe/nginx/default.conf diff --git a/stacks/recipe/Dockerfile b/stacks/recipe/Dockerfile index fe5b15a..3170de3 100644 --- a/stacks/recipe/Dockerfile +++ b/stacks/recipe/Dockerfile @@ -1,8 +1,9 @@ # Use the lightweight Nginx image FROM nginx:alpine -# Copy everything from your repository into the Nginx serving directory -COPY ./ /usr/share/nginx/html +COPY nginx/default.conf /etc/nginx/conf.d/default.conf +COPY index.html /usr/share/nginx/html/ +COPY js /usr/share/nginx/html/js +COPY css /usr/share/nginx/html/css -# Tell Docker this container listens on port 80 EXPOSE 80 \ No newline at end of file diff --git a/stacks/recipe/nginx/default.conf b/stacks/recipe/nginx/default.conf new file mode 100644 index 0000000..bce456a --- /dev/null +++ b/stacks/recipe/nginx/default.conf @@ -0,0 +1,14 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + # Do not store responses in browser or shared caches (Cloudflare, etc. respect unless overridden) + add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0" always; + add_header Pragma "no-cache" always; + + location / { + try_files $uri $uri/ /index.html; + } +}