summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile1
-rw-r--r--nginx.conf27
2 files changed, 28 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
index 13e017b..91f0185 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,6 +12,7 @@ RUN npm run build
FROM nginx:alpine as lizdotcoffee
COPY --from=builder /app/_site /usr/share/nginx/html
+COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 0000000..532232e
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,27 @@
+server {
+ listen 80;
+ server_name _;
+ root /usr/share/nginx/html;
+ index index.html;
+
+ location ~* \.html$ {
+ add_header Cache-Control "no-cache, no-store, must-revalidate";
+ add_header Pragma "no-cache";
+ add_header Expires "0";
+ }
+
+ location = / {
+ add_header Cache-Control "no-cache, no-store, must-revalidate";
+ add_header Pragma "no-cache";
+ add_header Expires "0";
+ try_files /index.html =404;
+ }
+
+ location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot|mp4|webm)$ {
+ add_header Cache-Control "public, max-age=31536000, immutable";
+ }
+
+ location / {
+ try_files $uri $uri/ =404;
+ }
+}