feat: fallback for weird html caching
This commit is contained in:
parent
e51d1690b3
commit
4779bb8100
@ -11,4 +11,5 @@ RUN yarn build
|
|||||||
FROM nginx:latest as result
|
FROM nginx:latest as result
|
||||||
WORKDIR /usr/share/nginx/html
|
WORKDIR /usr/share/nginx/html
|
||||||
COPY --from=build /usr/app/build/ /usr/share/nginx/html
|
COPY --from=build /usr/app/build/ /usr/share/nginx/html
|
||||||
|
COPY fallback.js /usr/share/nginx/html/fallback.js
|
||||||
COPY hub.conf /etc/nginx/conf.d/default.conf
|
COPY hub.conf /etc/nginx/conf.d/default.conf
|
||||||
|
20
fallback.js
Normal file
20
fallback.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
var div = document.createElement('div');
|
||||||
|
|
||||||
|
div.textContent = 'Произошла ошибка, для оперативного устранения отпишите пожалуйста в тп.';
|
||||||
|
|
||||||
|
div.style.position = 'fixed';
|
||||||
|
div.style.top = '0';
|
||||||
|
div.style.left = '0';
|
||||||
|
div.style.width = '100%';
|
||||||
|
div.style.height = '100%';
|
||||||
|
div.style.backgroundColor = 'rgba(0,0,0,0.7)';
|
||||||
|
div.style.color = 'white';
|
||||||
|
div.style.display = 'flex';
|
||||||
|
div.style.justifyContent = 'center';
|
||||||
|
div.style.alignItems = 'center';
|
||||||
|
div.style.fontSize = '20px';
|
||||||
|
div.style.padding = '50px';
|
||||||
|
div.style.boxSizing = 'border-box';
|
||||||
|
div.style.zIndex = '10000';
|
||||||
|
|
||||||
|
document.body.appendChild(div);
|
5
hub.conf
5
hub.conf
@ -2,6 +2,11 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
|
location ~* \.js$ {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
try_files $uri $uri/ /fallback.js;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
|
Loading…
Reference in New Issue
Block a user