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

CRDCDH-2450 Add react-specific caching policies #647

Open
wants to merge 2 commits into
base: 3.3.0
Choose a base branch
from
Open
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
18 changes: 16 additions & 2 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,22 @@ server {
return 301 /submission-request/$1;
}

location / {
try_files $uri $uri/ /index.html;
location / {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the configuration file through a security check using the following tool:
https://www.getpagespeed.com/check-nginx-config

It brought up some valid concerns such as nesting the "add_header" drops parent headers, as well as the try_files should probably be used with open_file_cache to negate overhead caused by try_files alone. Please take a look.

location ~ index.html {
add_header Cache-Control "private, no-cache, no-store, must-revalidate";
add_header Expires "Sat, 01 Jan 2000 00:00:00 GMT";
add_header Pragma no-cache;
}

location ~ js/injectEnv.js {
expires 1h;
}

location ~* \.(gif|jpe?g|png|webp|ico|svg|css|js|mp4)$ {
expires 1M;
}

try_files $uri $uri/ /index.html;
}

location /nginx_status {
Expand Down