Skip to content

Instantly share code, notes, and snippets.

@scotthansonde
Last active February 9, 2023 08:23
Show Gist options
  • Select an option

  • Save scotthansonde/d7501ad20539259d46ff88cfb1dabf5a to your computer and use it in GitHub Desktop.

Select an option

Save scotthansonde/d7501ad20539259d46ff88cfb1dabf5a to your computer and use it in GitHub Desktop.
Caddyfile for secure websockets with PagePark
# If you are running myfeedland.io behind PagePark in config.json set
# "urlWebsocketServerForClient": "wss://myfeedland.io/"
# so Caddy can catch the websocket requests
{
on_demand_tls {
ask http://localhost:1339/isdomainvalid
interval 2m
burst 5
}
}
https:// {
tls {
on_demand
}
# Define named matcher for websockets on myfeedland.io
# This is a set of rules that we can use later for an action
@websocketsFeedland {
host myfeedland.io
header Connection *Upgrade*
header Upgrade websocket
}
# Send those requests to the local websocket server
reverse_proxy @websocketsFeedland localhost:1462
# Send all other requests to PagePark
reverse_proxy localhost:1339
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment