doc: How to host React sites with Caddy? #692
Labels
documentation
Improvements or additions to documentation
good first issue
Good for newcomers
hacktoberfest
up-for-grabs
By default, React doesn't follow HTTP and HTML standards for URLs - it has a proprietary system that requires hijacking 404s, always serving
index.html
, and then presenting Not Found errors on the client-side instead.We need to add an example of how to do this with Caddy to the Cheat Sheet:
https://github.com/webinstall/webi-installers/tree/main/caddy
Note: we need to make sure that special routes
/api/
,/assets/
,/js/
, etc are still handled correctly - probably a "try first, then" / waterfall type of system.For example:
handle /api/*
=> always reverse_proxy, or fail with 404handle /assets/
=> tryroot /srv/www{path}
, or fail with 404handle /*
=> tryroot /srv/www{path}
, or serveindex.html
(NEVER 404)The text was updated successfully, but these errors were encountered: