diff --git a/Dockerfile b/Dockerfile index e62b867d38..601f2cdbbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,5 +33,8 @@ COPY --from=builder /src/webapp /app # Insert wasm type into Nginx mime.types file so they load correctly. RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types +# Override default nginx config +COPY /nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf + RUN rm -rf /usr/share/nginx/html \ && ln -s /app /usr/share/nginx/html diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf new file mode 100644 index 0000000000..bd2225ba4b --- /dev/null +++ b/nginx/conf.d/default.conf @@ -0,0 +1,18 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html index.htm; + + # Set no-cache for the index.html only so that browsers always check for a new copy of Element Web. + location = /index.html { + add_header Cache-Control "no-cache"; + } + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; +} +