Closed noerw closed 7 years ago
Maybe you could investigate a little too?
This is the Caddy config for books.sensebox.de
www.books.sensebox.de, books.sensebox.de {
gzip
log / stdout
errors / stdout
proxy / https://sensebox.github.io/books
}
github enforces a trailing slash and redirects with their full domain, not only the path. so our proxy has to perform this redirect before github does. this applies to any ghpages site with a custom domain.
try this:
www.books.sensebox.de, books.sensebox.de {
gzip
log / stdout
errors stdout
# enforce trailing slash
redir {
if {path} match \/[^\.\/]+$
/ {path}/
}
proxy / https://sensebox.github.io/books
}
interestingly, they also redirect https://example.com/foo -> http://example.com/foo/
which is obviously unsafe.
not shure if the above config covers that, as i tested locally without TLS
This doesn't work :( You are right with the trailing slash.
Maybe we should look into serving all static html currently hosted on gh pages through the https://caddyserver.com/docs/git plugin of caddy.
@mpfeil Objections?
@noerw Could you look into the git plugin and suggest modifications?
looks fine to me. let's give it a try
Redirect is working right now.
We are using git
plugin of caddy now.
when no trailing slash is provided in a call to
https://books.sensebox.de/*
, the URL gets redirected tohttp://sensebox.github.io/books/*/
, which may get confusing to the user. @ubergesundheit