mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Merge pull request #19203 from vector-im/add-cache-control-nginx
Return cache-control: no-cache from Docker nginx for /
This commit is contained in:
commit
54c2e8fc8e
@ -33,5 +33,8 @@ COPY --from=builder /src/webapp /app
|
|||||||
# Insert wasm type into Nginx mime.types file so they load correctly.
|
# Insert wasm type into Nginx mime.types file so they load correctly.
|
||||||
RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types
|
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 \
|
RUN rm -rf /usr/share/nginx/html \
|
||||||
&& ln -s /app /usr/share/nginx/html
|
&& ln -s /app /usr/share/nginx/html
|
||||||
|
18
nginx/conf.d/default.conf
Normal file
18
nginx/conf.d/default.conf
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user