2020-09-30 08:29:24 +00:00
|
|
|
# redirect www to bare domain
|
|
|
|
www.example.com {
|
|
|
|
redir https://example.com{uri} permanent
|
|
|
|
}
|
|
|
|
|
|
|
|
example.com {
|
|
|
|
# log to stdout, which is captured by journalctl
|
|
|
|
log {
|
|
|
|
output stdout
|
|
|
|
format console
|
|
|
|
}
|
|
|
|
|
|
|
|
# turn on standard streaming compression
|
|
|
|
encode gzip zstd
|
|
|
|
|
|
|
|
# reverse proxy /api to :3000
|
|
|
|
reverse_proxy /api/* localhost:3000
|
2020-10-11 00:03:16 +00:00
|
|
|
reverse_proxy /.well-known/openid-configuration localhost:3000
|
|
|
|
reverse_proxy /.well-known/jwks.json localhost:3000
|
2020-09-30 08:29:24 +00:00
|
|
|
|
|
|
|
# serve static files from public folder, but not /api
|
|
|
|
@notApi {
|
|
|
|
file {
|
|
|
|
try_files {path} {path}/ {path}/index.html
|
|
|
|
}
|
|
|
|
not path /api/*
|
2020-10-11 00:03:16 +00:00
|
|
|
not path /.well-known/openid-configuration
|
|
|
|
not path /.well-known/jwks.json
|
2020-09-30 08:29:24 +00:00
|
|
|
}
|
|
|
|
route {
|
|
|
|
rewrite @notApi {http.matchers.file.relative}
|
|
|
|
}
|
|
|
|
root * /srv/example.com/public/
|
|
|
|
file_server
|
|
|
|
}
|