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
Redirect adding trailing slash to dir removes path from label #2555
Comments
Experienced the same issue. Have you tried downgrading to a previous version? |
There is also a problem with Caddy browse template, where all hrefs are defined as |
https://github.com/mholt/caddy/blob/c32a0f5f712f0dee7b473946fcee65e826501e56/caddyhttp/browse/browse.go#L386 Maybe we should prepend root before redirect URL here? |
Can you actually try this with Caddy 2 (currently in beta on the v2 branch) and see if this is still an issue? I haven't tested much with how paths in the site address are handled yet, but I believe it's a bit different in v2. |
Closing due to lack of activity |
1. Which version of Caddy are you using (
caddy -version
)?caddy-0.11.4 (voidlinux build)
2. What are you trying to do?
I'm trying to host a directory with several subdirectories in a user's home folder under a fixed path.
3. What is your Caddyfile?
4. How did you run Caddy (give the full command and describe the execution environment)?
Provided voidlinux runit script, also
caddy
without further options, no difference.5. Please paste any relevant HTTP request(s) here.
Working request (existing directory):
curl -v https://qwertyuiop.de/\~crater2150/photo/
Failing request (no trailing slash)
curl -v https://qwertyuiop.de/\~crater2150/photo
6. What did you expect to see?
Caddy should redirect url without trailing slash to same url with trailing slash, if it is a directory, i.e. HTTP header:
7. What did you see instead (give full error messages and/or log)?
Caddy redirects to url with trailing slash added, but removes path from label in config file, i.e.:
8. Why is this a bug, and how do you think this should be fixed?
The rewrite adding a slash for directories should preserve the full url, including a path matching in the label.
9. What are you doing to work around the problem in the meantime?
I tried using
rewrite
to work around it with no success yet.Bonus: What do you use Caddy for? Why did you choose Caddy?
Private server with several proxied services like radicale etc. and some plain file directories. I chose Caddy, because of it's nice and clean config file syntax.
The text was updated successfully, but these errors were encountered: