mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-06 11:15:34 -06:00
Configure nixpacks to use Caddy
This commit is contained in:
36
frontend/Caddyfile
Normal file
36
frontend/Caddyfile
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
# 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 gzip
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user