mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-20 02:09:15 +01:00
prevent caching of index.html, add cache-control header for other requests as well (#3992)
This commit is contained in:
parent
8d72c83ca9
commit
6965b6ceae
@ -32,6 +32,13 @@ server {
|
|||||||
root /var/www/letsencrypt;
|
root /var/www/letsencrypt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location = /index.html {
|
||||||
|
# internal means that it can't be called from outside
|
||||||
|
internal;
|
||||||
|
# add no-store to prevent caching of index.html
|
||||||
|
add_header Cache-Control 'no-store';
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# make sure to have https link to exact same host that was called
|
# make sure to have https link to exact same host that was called
|
||||||
sub_filter '<a href="https://HOST_SET_BY_NGINX/' '<a href="https://$host/';
|
sub_filter '<a href="https://HOST_SET_BY_NGINX/' '<a href="https://$host/';
|
||||||
@ -39,7 +46,7 @@ server {
|
|||||||
# First attempt to serve request as file, then
|
# First attempt to serve request as file, then
|
||||||
# as directory, then fall back to displaying a 404.
|
# as directory, then fall back to displaying a 404.
|
||||||
try_files $uri $uri/ /index.html =404;
|
try_files $uri $uri/ /index.html =404;
|
||||||
|
add_header Cache-Control "no-cache, must-revalidate";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,13 @@ server {
|
|||||||
root /var/www/letsencrypt;
|
root /var/www/letsencrypt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location = /index.html {
|
||||||
|
# internal means that it can't be called from outside
|
||||||
|
internal;
|
||||||
|
# add no-store to prevent caching of index.html
|
||||||
|
add_header Cache-Control 'no-store';
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# make sure to have https link to exact same host that was called
|
# make sure to have https link to exact same host that was called
|
||||||
sub_filter '<a href="https://HOST_SET_BY_NGINX/' '<a href="https://$host/';
|
sub_filter '<a href="https://HOST_SET_BY_NGINX/' '<a href="https://$host/';
|
||||||
@ -30,7 +37,7 @@ server {
|
|||||||
# First attempt to serve request as file, then
|
# First attempt to serve request as file, then
|
||||||
# as directory, then fall back to displaying a 404.
|
# as directory, then fall back to displaying a 404.
|
||||||
try_files $uri $uri/ /index.html =404;
|
try_files $uri $uri/ /index.html =404;
|
||||||
|
add_header Cache-Control "no-cache, must-revalidate";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user