Skip to content

Commit

Permalink
Update Caddyfile
Browse files Browse the repository at this point in the history
  • Loading branch information
barrfalk committed Apr 28, 2024
1 parent bb5223b commit 712cda3
Showing 1 changed file with 42 additions and 49 deletions.
91 changes: 42 additions & 49 deletions frontend/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,55 +1,48 @@
{
auto_https off
admin off
auto_https off
admin 0.0.0.0:3003
servers {
metrics
}
}
:3000 {
log {
output stdout
format console {
time_format iso8601
level_format color
}
level {$LOG_LEVEL}
}
handle /static/js/config.js {
header {
Content-Type text/javascript
}
respond `window.REACT_APP_KEYCLOAK_URL="{$KEYCLOAK_URL}";
window.REACT_APP_KEYCLOAK_REALM="standard";
window.REACT_APP_KEYCLOAK_CLIENT_ID="ticdi-2-5398";
window.REACT_APP_API_URL="{$BACKEND_URL}";`
}

root * /app/dist
encode zstd gzip
file_server
@spa_router {
not path /api/* /static/js/config.js
file {
try_files {path} /index.html
}
}
rewrite @spa_router {http.matchers.file.relative}
# Proxy requests to API service
reverse_proxy /api/* {$BACKEND_URL} {
header_up Host {http.reverse_proxy.upstream.hostport}
header_up X-Real-IP {remote_host}
header_up X-Forwarded-For {remote_host}
}
header {
X-Frame-Options "SAMEORIGIN"
X-XSS-Protection "1;mode=block"
Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate"
X-Content-Type-Options "nosniff"
Strict-Transport-Security "max-age=31536000"
Content-Security-Policy "default-src 'self' https://*.gov.bc.ca data:; script-src https://*.gov.bc.ca 'self' 'unsafe-eval' https://www2.gov.bc.ca ; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://use.fontawesome.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https://fonts.googleapis.com http://www.w3.org https://*.gov.bc.ca https://*.tile.openstreetmap.org; connect-src 'self' https://nr-ticdi-* https://*.loginproxy.gov.bc.ca"
Referrer-Policy "same-origin"
Feature-Policy "fullscreen 'self'; camera 'none'; microphone 'none'"
}
log {
output stdout
format console {
time_format iso8601
level_format color
}
level {$LOG_LEVEL}
}
root * /srv
encode zstd gzip
file_server
@spa_router {
not path /api/*
file {
try_files {path} /index.html
}
}
rewrite @spa_router {http.matchers.file.relative}
# Proxy requests to API service
reverse_proxy /api/* {$BACKEND_URL} {
header_up Host {http.reverse_proxy.upstream.hostport}
header_up X-Real-IP {remote_host}
header_up X-Forwarded-For {remote_host}
}
header {
X-Frame-Options "SAMEORIGIN"
X-XSS-Protection "1;mode=block"
Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate"
X-Content-Type-Options "nosniff"
Strict-Transport-Security "max-age=31536000"
Content-Security-Policy "default-src 'self' https://spt.apps.gov.bc.ca data:; script-src 'self' 'unsafe-eval' https://www2.gov.bc.ca ;style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://use.fontawesome.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https://fonts.googleapis.com http://www.w3.org https://*.gov.bc.ca"
Referrer-Policy "same-origin"
Feature-Policy "fullscreen 'self'; camera 'none'; microphone 'none'"
}
}
:3001 {
handle /health {
respond "OK"
}
handle /health {
respond "OK"
}
}

0 comments on commit 712cda3

Please sign in to comment.