Compare commits
1 Commits
nginx-cach
...
docker-lab
Author | SHA1 | Date | |
---|---|---|---|
e2b101eb89
|
@ -13,3 +13,8 @@ FROM nginx as ki-frontend
|
|||||||
|
|
||||||
COPY --from=builder /dist/ /usr/share/nginx/html/
|
COPY --from=builder /dist/ /usr/share/nginx/html/
|
||||||
COPY etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
COPY etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.source=https://git.wtf-eg.de/kompetenzinventar/ki-frontend.git
|
||||||
|
LABEL org.opencontainers.image.url=https://git.wtf-eg.de/kompetenzinventar/ki-frontend
|
||||||
|
LABEL org.opencontainers.image.documentation=https://git.wtf-eg.de/kompetenzinventar/ki-frontend#docker
|
||||||
|
LABEL org.opencontainers.image.vendor="WTF Kooperative eG"
|
||||||
|
@ -9,24 +9,10 @@ server {
|
|||||||
|
|
||||||
#access_log /var/log/nginx/host.access.log main;
|
#access_log /var/log/nginx/host.access.log main;
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
|
|
||||||
# routes without dots serve the index.html without caching
|
|
||||||
location / {
|
location / {
|
||||||
add_header Cache-Control "no-cache";
|
root /usr/share/nginx/html;
|
||||||
try_files $uri $uri/index.html /index.html;
|
index index.html index.htm;
|
||||||
}
|
try_files $uri $uri/ /index.html;
|
||||||
|
|
||||||
# static js and css files that get replaced instead of updated
|
|
||||||
location ~ \.(js|css) {
|
|
||||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
# cache other static files for 30 days
|
|
||||||
location ~ \.(?!html) {
|
|
||||||
add_header Cache-Control "public, max-age=2592000";
|
|
||||||
try_files $uri =404;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#error_page 404 /404.html;
|
#error_page 404 /404.html;
|
||||||
|
Reference in New Issue
Block a user