Skip to content

Instantly share code, notes, and snippets.

@binaryben
Forked from a-s-o/Caddyfile
Created November 5, 2017 07:47
Show Gist options
  • Save binaryben/3ab66885e7fc124c1470a6e478755f7e to your computer and use it in GitHub Desktop.
Save binaryben/3ab66885e7fc124c1470a6e478755f7e to your computer and use it in GitHub Desktop.
Single page app rewriting with Caddy server
localhost:80
gzip
ext .html
root /home/deploy/current/build/www
proxy /graphql localhost:3000
rewrite /login {
to {path} /login
}
rewrite /app {
to {path} /
}
errors {
log caddy_error.log {
size 50 # Rotate after 50 MB
age 30 # Keep rotated files for 30 days
keep 5 # Keep at most 5 log files
}
404 404.html # Not Found
500 500.html # Internal Server Error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment