···11-{ # global options
22- admin off # theres no need for the admin api in railway's environment
33- persist_config off # storage isn't persistent anyway
44- auto_https off # railway handles https for us, this would cause issues if left enabled
55- log { # runtime logs
66- format console # set runtime log format to console mode
77- }
88- servers { # server options
99- trusted_proxies static private_ranges # trust railway's proxy
1010- }
11+# global options
22+{
33+ admin off # theres no need for the admin api in railway's environment
44+ persist_config off # storage isn't persistent anyway
55+ auto_https off # railway handles https for us, this would cause issues if left enabled
66+ # runtime logs
77+ log {
88+ format json # set runtime log format to json mode
99+ }
1010+ # server options
1111+ servers {
1212+ trusted_proxies static private_ranges # trust railway's proxy
1313+ }
1114}
12151313-:{$PORT} { # site block, listens on the $PORT environment variable, automatically assigned by railway
1414- log { # access logs
1515- format console # set access log format to console mode
1616- }
1616+# site block, listens on the $PORT environment variable, automatically assigned by railway
1717+:{$PORT} {
1818+ # access logs
1919+ log {
2020+ format json # set access log format to json mode
2121+ }
17221818- reverse_proxy {$FRONTEND_HOST} # proxy all requests for /* to the frontend, configure this variable in the service settings
2323+ reverse_proxy {$FRONTEND_HOST} # proxy all requests for /* to the frontend, configure this variable in the service settings
19242020- # the handle_path directive will strip /api/ from the path before proxying
2121- # this is needed if your backend's api routes don't start with /api/
2222- # change paths as needed
2323- handle_path /api/* { # this strips the /api/ prefix from the uri sent to the proxy address
2424- reverse_proxy {$BACKEND_HOST} # proxy all requests for /api/* to the backend, configure this variable in the service settings
2525- }
2525+ # the handle_path directive will strip /api/ from the path before proxying
2626+ # this is needed if your backend's api routes don't start with /api/
2727+ # change paths as needed
2828+ handle_path /api/* {
2929+ # this strips the /api/ prefix from the uri sent to the proxy address
3030+ reverse_proxy {$BACKEND_HOST} # proxy all requests for /api/* to the backend, configure this variable in the service settings
3131+ }
26322727- # if your backend's api routes do start with /api/ then you wouldn't want to strip the path prefix
2828- # if so, comment out the above handle_path block, and uncomment this reverse_proxy directive
2929- # change paths as needed
3030- # reverse_proxy {$BACKEND_HOST} # configure this variable in the service settings
3131-}3333+ # if your backend's api routes do start with /api/ then you wouldn't want to strip the path prefix
3434+ # if so, comment out the above handle_path block, and uncomment this reverse_proxy directive
3535+ # change paths as needed
3636+ # reverse_proxy {$BACKEND_HOST} # configure this variable in the service settings
3737+}