Skip to content

Commit

Permalink
feat: minor Caddyfile improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Oct 25, 2023
1 parent 4f1c54a commit f133704
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Caddyfile
@@ -1,6 +1,6 @@
# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config
{
order mercure before request_header
order mercure after encode

{$GLOBAL_OPTIONS}
}
Expand Down
2 changes: 1 addition & 1 deletion Caddyfile.dev
@@ -1,6 +1,6 @@
# Learn how to configure the Mercure.rocks Hub on https://mercure.rocks/docs/hub/config
{
order mercure before request_header
order mercure after encode

{$GLOBAL_OPTIONS}
}
Expand Down
30 changes: 11 additions & 19 deletions docs/hub/config.md
Expand Up @@ -11,31 +11,23 @@ A minimal `Caddyfile` for the Mercure hub looks like this:

```Caddyfile
# The address of your server
localhost
route {
mercure {
# Publisher JWT key
publisher_jwt !ChangeThisMercureHubJWTSecretKey!
# Subscriber JWT key
subscriber_jwt !ChangeThisMercureHubJWTSecretKey!
}
respond "Not Found" 404
localhost {
mercure {
# Publisher JWT key
publisher_jwt !ChangeThisMercureHubJWTSecretKey!
# Subscriber JWT key
subscriber_jwt !ChangeThisMercureHubJWTSecretKey!
}
respond "Not Found" 404
}
```

Caddy will automatically generate a Let's Encrypt TLS certificate for you! So you can use HTTPS.
To disable HTTPS entirely, set the [`auto_https`](https://caddyserver.com/docs/caddyfile/options#auto-https) global option to off:
To disable HTTPS, prefix the name of the server by `http://`:

```Caddyfile
{
auto_https off
}
my-domain.test:3000
route {
http://my-domain.test:3000 {
# ...
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/hub/debug.md
Expand Up @@ -8,7 +8,7 @@ To enable the profiler, add the `debug` global directive to your `Caddyfile`:

```Caddyfile
{
debug
debug
}
# ...
Expand Down

0 comments on commit f133704

Please sign in to comment.