mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-06 05:15:35 -06:00
40 lines
900 B
Caddyfile
40 lines
900 B
Caddyfile
{
|
|
# global options
|
|
admin off # theres no need for the admin api in railway's environment
|
|
persist_config off # storage isn't persistent anyway
|
|
auto_https off # railway handles https for us, this would cause issues if left enabled
|
|
log {
|
|
# runtime logs
|
|
format json # set runtime log format to json mode
|
|
}
|
|
servers {
|
|
# server options
|
|
trusted_proxies static private_ranges 100.0.0.0/8 # trust railway's proxy
|
|
}
|
|
}
|
|
|
|
# site block, listens on the $PORT environment variable, automatically assigned by railway
|
|
:{$PORT} {
|
|
respond /health 200
|
|
encode {
|
|
zstd fastest
|
|
gzip 3
|
|
}
|
|
|
|
log {
|
|
# access logs
|
|
format json # set access log format to json mode
|
|
}
|
|
|
|
handle /api/* {
|
|
reverse_proxy {$BACKEND_URL} # reverse proxy to the backend
|
|
}
|
|
|
|
handle {
|
|
root * dist
|
|
file_server
|
|
# if path doesn't exist, redirect it to 'index.html' for client side routing
|
|
try_files {path} /index.html
|
|
}
|
|
}
|