Skip to content

Commit

Permalink
Merge pull request #198 from Klantinteractie-Servicesysteem/feature/#186
Browse files Browse the repository at this point in the history
-cache-control

Add a default.conf.template with cache control headers for index.html and env.js
  • Loading branch information
felixcicatt authored Jul 21, 2022
2 parents cac1236 + 9002f8b commit 6b842c3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM nginx:alpine

COPY docker/nginx/default.conf.template /etc/nginx/templates/default.conf.template
COPY ./dist /usr/share/nginx/html
1 change: 1 addition & 0 deletions DockerfileDev
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ RUN npm test

FROM nginx:alpine
EXPOSE 80
COPY docker/nginx/default.conf.template /etc/nginx/templates/default.conf.template
COPY --from=builder /app/dist /usr/share/nginx/html
14 changes: 14 additions & 0 deletions docker/nginx/default.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
server {
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html$is_args$args;
}

location = /index.html {
internal;
add_header "Cache-Control" "no-cache" ;
}
location = /env.js {
add_header "Cache-Control" "no-cache" ;
}
}

0 comments on commit 6b842c3

Please sign in to comment.