Skip to content

Instantly share code, notes, and snippets.

@wancaibida
Created June 3, 2020 13:09
Show Gist options
  • Save wancaibida/4e0e30c2f1c5cc4848f7e492ed4b9d9b to your computer and use it in GitHub Desktop.
Save wancaibida/4e0e30c2f1c5cc4848f7e492ed4b9d9b to your computer and use it in GitHub Desktop.
Caddyfile v2 example
yourdomain.com {
tls email@abc.com
root * /srv/www
file_server
handle_errors {
@404 {
expression int({http.error.status_code}) == 404
}
respond @404 "This is 404 error message"
}
@ws {
header Connection Upgrade
header Upgrade websocket
}
reverse_proxy @ws localhost:6443
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment