-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gate access to static files via backend #3347
Comments
I've written a plugin that I'm using for a toy site, but don't know enough about Caddy or its design principles to feel comfortable putting it up as a PR yet. If you can provide some feedback or guidance, I'd be happy to submit it, but for now I'll just put it here for other people to use: https://gist.github.com/toraora/76016ef1fed9b551121ce41672c001bd |
Neat! You could take a look at some of the other Caddy v2 modules in this list to see how the organize their github repos as plugins: https://caddy.community/t/list-of-caddy-2-modules/7839 The one thing that I think is glaringly missing is Caddyfile support, which is pretty easy to implement. There's a doc here that explains the process: https://caddyserver.com/docs/extending-caddy/caddyfile |
Nice work @toraora ! But, this can be done using Caddy's built-in reverse proxy: 538ddb8#diff-3820b4f14e2fee163a1894dbf2560bd9R97-R109 It'll go out with 2.1 so it'll be documented on the website around that time. Still needs Caddyfile support. But it should do the trick! And is way more flexible than working only with X-Accel-Redirect. |
Hi @mholt, do you have an ETA for the Caddyfile support? at least an issue we can follow? |
I don't yet; feel free to submit a PR to expedite the change! |
Do you have a spec of what you want to expose and how in Caddyfile? An example of final Caddyfile and what it should produce would be very appreciated before implementing anything :) |
Sure, I can come up with something -- can you open a new issue to request that feature? |
Maybe something like this:
(Responses can be matched by headers or status code. Just showing a few examples here.) |
This is basically
X-Accel-Redirect
in Nginx, and it used to exist ashttp.internal
in Caddy 1, but I don't seem to be able to find a way to implement this behavior in Caddy 2The text was updated successfully, but these errors were encountered: