Last active
February 9, 2023 08:23
-
-
Save scotthansonde/d7501ad20539259d46ff88cfb1dabf5a to your computer and use it in GitHub Desktop.
Caddyfile for secure websockets with PagePark
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
| # 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