Skip to content

Instantly share code, notes, and snippets.

@shahidcodes
Last active June 3, 2024 01:13
Show Gist options
  • Save shahidcodes/a29481d317b72d96776cf8e65ef2e3d5 to your computer and use it in GitHub Desktop.
Save shahidcodes/a29481d317b72d96776cf8e65ef2e3d5 to your computer and use it in GitHub Desktop.
Deploy react spa on caddy, Caddy file
shahid.codes {
try_files {path} /
encode gzip
root * /usr/share/caddy
file_server
}
@pnappa
Copy link

pnappa commented Jun 3, 2024

First line now should be try_files {path} /index.html, as per: https://caddyserver.com/docs/caddyfile/patterns#single-page-apps-spas

The behaviour seems to have changed somewhere between 2.7.6 and 2.8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment