I’m trying to set up a simple reverse proxy, using a Caddyfile, but the browser receives a blank 200 response. It works when using command line arguments, but not a Caddyfile. Can someone spot my typo?
1. Caddy version (caddy version
):
v2.0.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
2. How I run Caddy:
a. System environment:
Windows 2016 Server 64-bit
b. Command:
caddy_2.0.0_windows_amd64\caddy.exe reverse-proxy --from :80 --to 127.0.0.1:8888
and
caddy_2.0.0_windows_amd64\caddy.exe run
c. Service/unit/compose file:
n/a
d. My complete Caddyfile or JSON config:
The command line generates this autosave.json
:
{"admin":{"disabled":true},"apps":{"http":{"servers":{"proxy":{"listen":[":80"],"routes":[{"handle":[{"handler":"reverse_proxy","transport":{"protocol":"http"},"upstreams":[{"dial":"127.0.0.1:8888"}]}]}]}}}}}
The following Caddyfile
http://localhost/ {
reverse_proxy http://127.0.0.1:8888
}
generates the following autosave.json
:
{"apps":{"http":{"servers":{"srv0":{"automatic_https":{"skip":["localhost"]},"listen":[":80"],"routes":[{"handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"127.0.0.1:8888"}]}]}]}],"match":[{"host":["localhost"],"path":["/"]}],"terminal":true}]}}}}}
3. The problem I’m having:
Using the Caddyfile, the browser receives a status 200, xero byte length response
4. Error messages and/or full log output:
5. What I already tried:
I started with a bigger Caddyfile, but it’s been stripped down now to the minimum. And no HTTPS.