1. Output of caddy version
:
v2.6.2 h1:wKoFIxpmOJLGl3QXoo6PNbYvGW4xLEgo32GPBEjWL8o=
2. How I run Caddy:
I have a local file server started using python with the command
python -m http.server
and it starts at localhost:8000
and i accessed it with http://localhost:8000 and it works.
I want to reverse proxy it to a local domain so I can access it let’s say via kamal.local
a. System environment:
OS: Windows 11
b. Command:
caddy run
c. Service/unit/compose file:
Not using docker
d. My complete Caddy config:
kamal.local {
reverse_proxy localhost:8000
}
3. The problem I’m having:
Browser doesn’t resolve. Curl also doesnt resolve
C:\Users\Kamal>curl -v https://kamal.local
* Could not resolve host: kamal.local
* Closing connection 0
curl: (6) Could not resolve host: kamal.local
4. Error messages and/or full log output:
2022/12/10 01:58:37.354 INFO using adjacent Caddyfile
2022/12/10 01:58:37.359 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2022/12/10 01:58:37.359 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000591a40"}
2022/12/10 01:58:37.359 INFO http server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2022/12/10 01:58:37.360 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2022/12/10 01:58:37.361 INFO tls cleaning storage unit {"description": "FileStorage:C:\\Users\\Kamal\\AppData\\Roaming\\Caddy"}
2022/12/10 01:58:37.362 INFO tls finished cleaning storage units
2022/12/10 01:58:37.372 INFO pki.ca.local root certificate is already trusted by system {"path": "storage:pki/authorities/local/root.crt"}
2022/12/10 01:58:37.372 INFO http enabling HTTP/3 listener {"addr": ":443"}
2022/12/10 01:58:37.372 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2022/12/10 01:58:37.372 INFO http.log server running {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2022/12/10 01:58:37.372 INFO http enabling automatic TLS certificate management {"domains": ["kamal.local"]}
2022/12/10 01:58:37.375 WARN tls stapling OCSP {"error": "no OCSP stapling for [kamal.local]: no OCSP server specified in certificate", "identifiers": ["kamal.local"]}
2022/12/10 01:58:37.375 INFO autosaved config (load with --resume flag) {"file": "C:\\Users\\Kamal\\AppData\\Roaming\\Caddy\\autosave.json"}
2022/12/10 01:58:37.375 INFO serving initial configuration
5. What I already tried:
I tried using mac also doesnt work. I’m on windows now but it also doesnt work, tried adding tls internal
also doesnt work.
6. Links to relevant resources:
tried following this tutorial, seems simple but unfortunately i cant replicate it https://twitter.com/wesbos/status/1600145790692900864