Closed FroeMic closed 5 years ago
Don't you just want proxy /docs https://domain.com
?
You can pretty much combine all your blocks with the same domain into one. Proxy will take higher priority, so it should work altogether.
I'm going to close this, because ultimately this seems to be more of a usage question rather than an issue or bug with Caddy. I recommend asking on https://caddy.community for these types of questions in the future. Discussion can continue here though.
1. What version of Caddy are you using (
caddy -version
)?Caddy 0.11.1
2. What are you trying to do?
I try to proxy a specific path
/docs/*
to an subdomain of the host that exists only within the/etc/hosts
file, removing the/docs
segment from the url path.Context
The Laravel application that is running behind Caddy serves a small static wiki at the
docs.app.frhlch.at
url. Laravel makes sure, only authenticated (and authorized) users are served these files, so it is not in the public directory, accessible viaapp.frhlch.at
.The problem is that my DNS allows only max third-level domain entries. Ergo, it doesn't resolve
docs.app.frhlch.at
. This is why I want to use Caddy to proxy all request toapp.frhlch.at/docs/*
todocs.app.frhlch.at/*
with a/etc/hosts
entry that loops backdocs.app.frhlch.at
.Problem
However this always results in a
502 Bad Gateway
response.3. What is your entire Caddyfile?
/etc/hosts
4. How did you run Caddy (give the full command and describe the execution environment)?
Caddy runs in a Laradock container and is started with
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
. The specified Caddyfile is the one posted above.5. Please paste any relevant HTTP request(s) here.
6. What did you expect to see?
This is the output of curl run on the server. Similarly this static html file should be returned by Caddy.
7. What did you see instead (give full error messages and/or log)?
The log shows the following error:
where
xxx.xxx.xxx.xxx
is the full public ip of my server.