1. Caddy version (v2.4.6
):
2. How I run Caddy:
CLI
a. System environment:
Windows server 2016
b. Command:
caddy_windows_amd64.exe reverse-proxy --from localhost:8443 --to localhost:8080
c. Service/unit/compose file:
N/A
d. My complete Caddyfile or JSON config:
N/A
3. The problem I’m having:
We have a requirements database that is currently hosted at http://localhost:8080/database/
. Our goal is to set up a reverse proxy so it’s accessible at https://localhost:8443/database/
. We chose caddy for the easy https and certificate handling (we will be getting a public DNS in the future). Using the command above worked the other day and functionality was as expected, but we had a power outage and we had to restart our server. Restarting caddy with the command above and navigating to https://localhost:8443/database/
simply takes us to http://localhost:8080/database/
instead of https://localhost:8443/database/
. http://localhost:8080/database/
was and continues to be accessible and behaves as expected.
To our understanding, this should work, but we are very new to Caddy (used for the first time two days ago) so we might be missing something glaringly obvious or it might not even be a caddy issue but we’re trying to explore every avenue for help.
4. Error messages and/or full log output:
No browser errors. Command line output:C:\caddy>caddy_windows_amd64.exe reverse-proxy --from localhost:8443 --to localhost:8080
2021/12/17 17:51:45.590 [33mWARN [0m admin admin endpoint disabled
2021/12/17 17:51:45.591 [34mINFO [0m http enabling automatic HTTP->HTTPS redirects {"server_name": "proxy"}
2021/12/17 17:51:45.591 [34mINFO [0m tls.cache.maintenance started background certificate maintenance {"cache": "0xc000236c40"}
2021/12/17 17:51:45.596 [34mINFO [0m tls cleaning storage unit {"description": "FileStorage:C:\\Users\\doorA\\AppData\\Roaming\\Caddy"}
2021/12/17 17:51:45.598 [34mINFO [0m tls finished cleaning storage units
2021/12/17 17:51:45.609 [33mWARN [0m pki.ca.local installing root certificate (you might be prompted for password) {"path": "storage:pki/authorities/local/root.crt"}
2021/12/17 09:51:45 Note: NSS support is not available on your platform
2021/12/17 09:51:48 certificate installed properly in Java keystore
2021/12/17 09:51:51 certificate installed properly in windows trusts
2021/12/17 17:51:51.243 [34mINFO [0m http enabling automatic TLS certificate management {"domains": ["localhost"]}
2021/12/17 17:51:51.244 [34mINFO [0m autosaved config (load with --resume flag) {"file": "C:\\Users\\doorA\\AppData\\Roaming\\Caddy\\autosave.json"}
Caddy proxying https://localhost:8443 -> http://localhost:8080
2021/12/17 17:51:51.250 [34mINFO [0m tls.obtain acquiring lock {"identifier": "localhost"}
2021/12/17 17:51:51.254 [34mINFO [0m tls.obtain lock acquired {"identifier": "localhost"}
2021/12/17 17:51:51.258 [34mINFO [0m tls.obtain certificate obtained successfully {"identifier": "localhost"}
2021/12/17 17:51:51.261 [34mINFO [0m tls.obtain releasing lock {"identifier": "localhost"}
2021/12/17 17:51:51.265 [33mWARN [0m tls stapling OCSP {"error": "no OCSP stapling for [localhost]: no OCSP server specified in certificate"}
5. What I already tried:
-Originally followed the reverse-proxy quickstart guide at Reverse proxy quick-start — Caddy Documentation and this worked and was satisfactory for us for the time being
-Stopping and restarting Caddy
-Restarting the server and it’s components
-Deleted files in AppData/Roaming/Caddy
-Running Caddy as admin and not admin
-Creating a caddy file instead of using the command above:
localhost
reverse-proxy --from localhost:8443 --to localhost:8080