1. The problem I’m having:
The reverse proxy works from one port to another on localhost. However, it is not working for domain name (bar.company.local) as defined in the caddy file.
2. Error messages and/or full log output:
The output for command (curl -k https://bar.company.local) is an empty line as shown below. I was expecting to see:
Goodbye, world! (foo.company.local)
C:\Users\rrudra>curl -k https://localhost:2017
Goodbye, world! (localhost:2017)
C:\Users\rrudra>curl -k https://localhost:2016
Goodbye, world! (localhost:2017)
C:\Users\rrudra>curl -k https://foo.company.local
Goodbye, world! (foo.company.local)
C:\Users\rrudra>curl -k https://bar.company.local
3. Caddy version:
v2.7.3 (on Windows)
4. How I installed and ran Caddy:
choco install caddy
a. System environment:
Windows 11 Enterprise (Version 21H2) (OS Build 22000.2538)
b. Command:
caddy run
d. My complete Caddy config:
localhost:2017 {
respond "Goodbye, world! (localhost:2017)"
}
localhost:2016 {
reverse_proxy https://localhost:2017
}
foo.company.local {
respond "Goodbye, world! (foo.company.local)"
}
bar.company.local {
reverse_proxy https://localhost:2017
}
Windows host file entries:
127.0.0.1 foo.company.local
127.0.0.1 bar.company.local
5. Links to relevant resources:
None