Hi all, trying to migrate from nginx to caddy, and encountering some issue for my usecase, maybe someone can help clarify some things for me
1. The problem I’m having:
I’m having an issue with configuring Caddy for my usecase. It must proxy pass request to api container, do try_files for minified JS builded react app, and serve static files from 2 of folders static and attachments.
All parts except serving static files from static and attachment path working.
For these, you probably want handle_path instead. When Caddy assembles the path to look on disk, it takes the root then appends the request path. So it would be looking in /static/static unless you strip the request path away. handle_path does that for you. Read the docs for a deeper explanation.
You don’t need the /admin/* in here since the handle matches that already.
Also, you could merge these two API routes together:
With this config attachments is working, but static is not, the only differences that static have sub-folders. so the path is like https://remembrancer.dufran.org/static/admin/css/dark_mode.css
Is there a way to make static directory recursive?