Created
November 26, 2018 00:01
-
-
Save vy-let/0fc8e7a77c2adb2f803431cfdf88c754 to your computer and use it in GitHub Desktop.
This file contains 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
masto.example.com { | |
root /path/to/your/mastodon/public | |
gzip | |
rewrite { | |
if {path} is / | |
to /proxy/{uri} | |
} | |
rewrite { | |
to {path} /proxy/{uri} | |
} | |
proxy /proxy localhost:3000 { | |
except /proxy/api/v1/streaming | |
without /proxy | |
transparent | |
} | |
proxy /proxy/api/v1/streaming 127.0.0.1:4000 { | |
without /proxy | |
transparent | |
websocket | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assumes you're running the web and streaming servers on the same machine as caddy. The only two snippets you'll need to update to make this work are
masto.example.com
root
directive.Note that this does work even if your firewall blocks 3000 and 4000.