Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds and removes headers for index.html to prevent it from being hashed #3392

Merged
merged 4 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ hs_err_pid*
/storage/
*.iml

# Jupyter notebook tutorial development
/workspace.code-workspace
**/Lib/
**/Include/
Expand All @@ -70,6 +71,9 @@ hs_err_pid*
**/pyvenv.cfg
tutorial/mimic_iii_demo/data/**

# Include frontend container assets
!/frontend/container/etc

/node_modules
cypress/screenshots/
cypress/videos/
3 changes: 3 additions & 0 deletions frontend.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ COPY --from=builder /app/dist /usr/share/nginx/html
# Copy the env replacer
COPY ./frontend/scripts/replace-env-at-runtime.sh /

# Copy nginx config
COPY ./frontend/container/ /

# The default command replaces the environment variables and starts nginx as a subprocess
CMD [ "/bin/sh", "-c", "/replace-env-at-runtime.sh /usr/share/nginx/html/index.html && nginx -g \"daemon off;\""]

Expand Down
26 changes: 26 additions & 0 deletions frontend/container/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
server {
listen 80;

gzip on;
gzip_vary on;
gzip_types */*;

location / {
root /usr/share/nginx/html;
index index.html;

location ~ ^/(index\.html)?$ {
add_header Cache-Control "no-store";
etag off;
}
}


# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

}

Loading