Soft fork for a caddy reverse template for railway
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use JSON logging

Brody cfbaf117 d980b7dc

+32 -26
+32 -26
Caddyfile
··· 1 - { # global options 2 - admin off # theres no need for the admin api in railway's environment 3 - persist_config off # storage isn't persistent anyway 4 - auto_https off # railway handles https for us, this would cause issues if left enabled 5 - log { # runtime logs 6 - format console # set runtime log format to console mode 7 - } 8 - servers { # server options 9 - trusted_proxies static private_ranges # trust railway's proxy 10 - } 1 + # global options 2 + { 3 + admin off # theres no need for the admin api in railway's environment 4 + persist_config off # storage isn't persistent anyway 5 + auto_https off # railway handles https for us, this would cause issues if left enabled 6 + # runtime logs 7 + log { 8 + format json # set runtime log format to json mode 9 + } 10 + # server options 11 + servers { 12 + trusted_proxies static private_ranges # trust railway's proxy 13 + } 11 14 } 12 15 13 - :{$PORT} { # site block, listens on the $PORT environment variable, automatically assigned by railway 14 - log { # access logs 15 - format console # set access log format to console mode 16 - } 16 + # site block, listens on the $PORT environment variable, automatically assigned by railway 17 + :{$PORT} { 18 + # access logs 19 + log { 20 + format json # set access log format to json mode 21 + } 17 22 18 - reverse_proxy {$FRONTEND_HOST} # proxy all requests for /* to the frontend, configure this variable in the service settings 23 + reverse_proxy {$FRONTEND_HOST} # proxy all requests for /* to the frontend, configure this variable in the service settings 19 24 20 - # the handle_path directive will strip /api/ from the path before proxying 21 - # this is needed if your backend's api routes don't start with /api/ 22 - # change paths as needed 23 - handle_path /api/* { # this strips the /api/ prefix from the uri sent to the proxy address 24 - reverse_proxy {$BACKEND_HOST} # proxy all requests for /api/* to the backend, configure this variable in the service settings 25 - } 25 + # the handle_path directive will strip /api/ from the path before proxying 26 + # this is needed if your backend's api routes don't start with /api/ 27 + # change paths as needed 28 + handle_path /api/* { 29 + # this strips the /api/ prefix from the uri sent to the proxy address 30 + reverse_proxy {$BACKEND_HOST} # proxy all requests for /api/* to the backend, configure this variable in the service settings 31 + } 26 32 27 - # if your backend's api routes do start with /api/ then you wouldn't want to strip the path prefix 28 - # if so, comment out the above handle_path block, and uncomment this reverse_proxy directive 29 - # change paths as needed 30 - # reverse_proxy {$BACKEND_HOST} # configure this variable in the service settings 31 - } 33 + # if your backend's api routes do start with /api/ then you wouldn't want to strip the path prefix 34 + # if so, comment out the above handle_path block, and uncomment this reverse_proxy directive 35 + # change paths as needed 36 + # reverse_proxy {$BACKEND_HOST} # configure this variable in the service settings 37 + }