Caddyfile root path not render

How to solve this? (/admin/users/ works fine)
:{$PORT} {
log {
format console
}

reverse_proxy {$FRONTEND_HOST}

handle_path /api/* {
reverse_proxy {$BACKEND_HOST}
}

handle_path /admin/* {
reverse_proxy {$ADMIN_HOST}
}
}
:{$PORT} {
log {
format console
}

reverse_proxy {$FRONTEND_HOST}

handle_path /api/* {
reverse_proxy {$BACKEND_HOST}
}

handle_path /admin/* {
reverse_proxy {$ADMIN_HOST}
}
}
Solution:
redir /admin /admin/ permanent
redir /admin /admin/ permanent
...
Jump to solution
25 Replies
Percy
Percy10mo ago
Project ID: N/A
Brody
Brody10mo ago
link to the proxy's domain please
หยอมแหยม
oh maybe i forgot to set base url in project (skill issues coolcry )
No description
Brody
Brody10mo ago
the caddyfile you sent, is that your entire caddyfile?
หยอมแหยม
no actually it's
{ # 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 console # set runtime log format to console mode
}
servers { # server options
trusted_proxies static private_ranges # trust railway's proxy
}
}

:{$PORT} {
log {
format console
}

reverse_proxy {$FRONTEND_HOST}

handle_path /api/* {
reverse_proxy {$BACKEND_HOST}
}

handle_path /admin/* {
reverse_proxy {$ADMIN_HOST}
}
}
{ # 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 console # set runtime log format to console mode
}
servers { # server options
trusted_proxies static private_ranges # trust railway's proxy
}
}

:{$PORT} {
log {
format console
}

reverse_proxy {$FRONTEND_HOST}

handle_path /api/* {
reverse_proxy {$BACKEND_HOST}
}

handle_path /admin/* {
reverse_proxy {$ADMIN_HOST}
}
}
nvm i think it's render only /admin/ but not work for /admin do i need to make it handle /admin too?
Brody
Brody10mo ago
/admin would count as a frontend path, and you should leave it that way you can setup a redirect if you absolutely think it's necessary
หยอมแหยม
alright, i'll try that
Brody
Brody10mo ago
keyword, if it's absolutely necessary
หยอมแหยม
hmm can you give me some example? it's slightly necessary because i separate backoffice project and storefront project and backoffice has same problem too
Brody
Brody10mo ago
you already said you can access it from /admin/ so i dont see the issue?
หยอมแหยม
yeah but /admin without / at end of path is not work
Brody
Brody10mo ago
right but why does that matter?
หยอมแหยม
im afraid that my team will confuse abit why they can't access admin route (so they don't know that need to add / in the end of path)
Brody
Brody10mo ago
tell them 🤣😆
หยอมแหยม
yeah ill try but it's would be great if I can make it work Sad
Want results from more Discord servers?
Add your server