element-web/apps/web/docker/nginx-templates/default.conf.template
Michael Telatynski fc391169da
Update nginx default config around caching (#32884)
* Update nginx default config around caching

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update README around caching

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2026-03-23 16:40:10 +00:00

36 lines
974 B
Plaintext

server {
listen ${ELEMENT_WEB_PORT};
listen [::]:${ELEMENT_WEB_PORT};
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Set no-cache for the version, config, i18n, and index.html
# so that browsers always check for a new copy of Element Web.
# NB http://your-domain/ and http://your-domain/? are also covered by this
location = /index.html {
add_header Cache-Control "no-cache";
}
location = /version {
add_header Cache-Control "no-cache";
}
location /i18n/ {
add_header Cache-Control "no-cache";
}
# covers config.json and config.hostname.json requests as it is prefix.
location /config {
root /tmp/element-web-config;
add_header Cache-Control "no-cache";
}
location /modules {
alias /modules;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
}