Last active
June 3, 2024 01:13
-
-
Save shahidcodes/a29481d317b72d96776cf8e65ef2e3d5 to your computer and use it in GitHub Desktop.
Deploy react spa on caddy, Caddy file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shahid.codes { | |
try_files {path} / | |
encode gzip | |
root * /usr/share/caddy | |
file_server | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First line now should be
try_files {path} /index.html
, as per: https://caddyserver.com/docs/caddyfile/patterns#single-page-apps-spasThe behaviour seems to have changed somewhere between 2.7.6 and 2.8.1.