1. Caddy version (caddy version
):
v2.2.0 h1:sMUFqTbVIRlmA8NkFnNt9l7s0e+0gw+7GPIrhty905A=
2. How I run Caddy:
Use the caddy exe in a local directory. Config file in same directory.
a. System environment:
Windows 10
b. Command:
caddy start
c. Service/unit/compose file:
NA
d. My complete Caddyfile or JSON config:
cruizer.asus.com {
log {
output file access.log {
roll_size 5MiB
roll_keep_for 168h
roll_keep 2
}
}
reverse_proxy /sonarr {
to localhost:8989
}
}
3. The problem I’m having:
I’m trying to use caddy as a reverse proxy for my Sonarr, Radarr services on the same machine. Will concentrate on Sonarr since I think I’m a little closer to getting it to work with caddy.
When I go to cruizer.asus.com/sonarr I get a 400 (HTTP Error 400. The request hostname is invalid.)
4. Error messages and/or full log output:
2020/10/13 01:05:34.827 error http.log.access.log0 handled request {“request”: {“remote_addr”: “192.168.1.1:51364”, “proto”: “HTTP/2.0”, “method”: “GET”, “host”: “cruizer.asus.com”, “uri”: “/sonarr”, “headers”: {“Accept-Encoding”: [“gzip, deflate, br”], “Dnt”: [“1”], “Upgrade-Insecure-Requests”: [“1”], “Te”: [“trailers”], “User-Agent”: [“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0”], “Accept”: [“text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8”], “Accept-Language”: [“en-US,en;q=0.5”]}, “tls”: {“resumed”: false, “version”: 772, “cipher_suite”: 4865, “proto”: “h2”, “proto_mutual”: true, “server_name”: “cruizer.asus.com”}}, “common_log”: “192.168.1.1 - - [13/Oct/2020:14:05:34 +1300] “GET /sonarr HTTP/2.0” 400 334”, “duration”: 0.0009976, “size”: 334, “status”: 400, “resp_headers”: {“Server”: [“Caddy”, “Microsoft-HTTPAPI/2.0”], “Content-Length”: [“334”], “Content-Type”: [“text/html; charset=us-ascii”], “Date”: [“Tue, 13 Oct 2020 01:05:34 GMT”]}}
5. What I already tried:
Rechecked port forwards on the router (443 to the box for TCP and UDP to be sure)
Tried various caddyfile configurations e.g. tried a trailing / on /sonarr/
Connecting to domain root gives me a blank page, I’m guessing the error is coming from Sonarr but not sure how to verify that.
I’ve done extensive research online to try and find an answer but most configurations I’m coming across are the same as mine.
Sonarr configured for /sonarr URL base
Tried this config:
cruizer.asus.com
respond "test"
It works
I’ve spent about 3 hours on this so far with no luck
Thanks for your help!