28 lines
713 B
Caddyfile
28 lines
713 B
Caddyfile
{$SITE_DOMAIN:localhost} {
|
|
encode gzip
|
|
# Brain-API unter /api/* (CORS fuer Extension + Web-App)
|
|
handle_path /api/* {
|
|
@pre method OPTIONS
|
|
header Access-Control-Allow-Origin "{$CORS_ORIGIN:*}"
|
|
header Access-Control-Allow-Methods "GET, POST, PUT, OPTIONS"
|
|
header Access-Control-Allow-Headers "Content-Type, Authorization"
|
|
respond @pre 204
|
|
reverse_proxy brain:8787 {
|
|
header_down -Access-Control-Allow-Origin
|
|
}
|
|
}
|
|
handle /landing/* {
|
|
root * /srv/app
|
|
file_server
|
|
}
|
|
handle {
|
|
root * /srv/app
|
|
@hidden path /.env* /.git* /brain/* /tests/* /node_modules/*
|
|
respond @hidden 404
|
|
file_server
|
|
}
|
|
header {
|
|
X-Content-Type-Options nosniff
|
|
Referrer-Policy strict-origin-when-cross-origin
|
|
}
|
|
}
|