3 # Redirect to https if not coming from https && not forwarded from https && not curl nor any health check user-agent
4 RewriteCond %{HTTPS} !=on
5 RewriteCond %{HTTP:X-Forwarded-Proto} !=https
6 RewriteCond %{HTTP_USER_AGENT} !(^kube-probe|^GoogleHC|^curl)
7 RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
9 # Ignore any requests to the assets folder, to avoid the index.html fallback and return 404 there
10 RewriteRule ^assets/ - [L]
12 # Redirect nothing to app
13 RewriteRule ^$ /index.html [NC,L]
16 RewriteRule ^.*?\.git.* /index.html [NC,L]
18 RewriteCond %{REQUEST_FILENAME} -s [OR]
19 RewriteCond %{REQUEST_FILENAME} -l [OR]
20 RewriteCond %{REQUEST_FILENAME} -d
21 RewriteRule ^.*$ - [NC,L]
23 # All shared URLs pages use version with noindex meta tag
24 RewriteRule ^urls\/(.*)$ /urls.html [NC,L]
27 RewriteRule ^oauth/callback /oauth.html [L]
29 RewriteRule ^(.*) /index.html [NC,L]
31 ErrorDocument 404 /assets/404.html
33 <Files ~ "(index.html|urls.html|version.json)">
36 Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
37 Header set Pragma "no-cache"
38 Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
42 Header set X-Robots-Tag "noindex"
45 # The download service worker gets chunk hash appended to the end of the filename
46 <Files ~ "^downloadSW">
47 Header set Service-Worker-Allowed "/"
48 Header set Service-Worker "script"
51 <IfModule mod_deflate.c>
52 AddOutputFilter INCLUDES;DEFLATE svg
55 # Browser should cache assets for 14 days
56 <FilesMatch ".(js|css)$">
57 Header set Cache-Control "max-age=1209600, public"