Hi, I had a working configuration for a year now. Something happened on my router and I could not get access to https://xxx.duckdns.org.
Now I factory reset my router, all seems working well, but still I am unable to access https://xxx.duckdns.org neither from outside, nor from inside the lan I receive
502 Bad Gateway
I can access fine
https:/192.168.1.xx:8123
My configuration is
port 443 to 443 and 80 to 80 are forwarded to 192.168.1.12 hassio machine
20-01-05 21:12:54 INFO (MainThread) [hassio.store] Load add-ons from store: 95 all - 0 new - 0 remove
20-01-05 21:23:57 INFO (SyncWorker_13) [hassio.docker.interface] Stop addon_fe41fc28_caddy application
20-01-05 21:23:57 INFO (SyncWorker_13) [hassio.docker.interface] Clean addon_fe41fc28_caddy application
20-01-05 21:23:58 INFO (SyncWorker_7) [hassio.docker.addon] Start Docker add-on korylprince/hassio-caddy-amd64 with version 1.6
20-01-05 21:26:15 INFO (SyncWorker_4) [hassio.docker.interface] Stop addon_fe41fc28_caddy application
20-01-05 21:26:16 INFO (SyncWorker_4) [hassio.docker.interface] Clean addon_fe41fc28_caddy application
20-01-05 21:26:16 INFO (SyncWorker_19) [hassio.docker.addon] Start Docker add-on korylprince/hassio-caddy-amd64 with version 1.6
20-01-05 21:31:32 INFO (MainThread) [hassio.homeassistant] Updated Home Assistant API token
That 502 error usually means Caddy isn’t running (for me) and your log seems to show it starting/restarting a couple of times?
You also seem to specify DNS challenge (so no need to forward port 80)
What happens if you go to 192.168.1.12:8123 in your browser? Can you go to addons and check the Caddy log? Can you also check that duckdns has the right IP address - I have had 502 when caddy isn’t started - sometimes when it’s renewing certificates (saw this after I switched to a Namecheap domain… the TTV was causing each certificate to take 30 mins to renew…) Also check your router is still allowing NAT loopback.
Ha! Not sure how that would have ever worked with specifying the ssl_cert and key. I have those commented out.
http:
# ssl_certificate: /ssl/fullchain.pem
# ssl_key: /ssl/privkey.pem
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- ::1
ip_ban_enabled: true
login_attempts_threshold: 5
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
base_url: !secret base_http_url
and base URL is https://xxx.yyy.zzz:xxxxx (I use a different port)
BTW - did you see where I said you don’t need port 80 forwarded anymore? You are using DNS validation not http now so unless you need port 80 for something else, remove that.
Caddy doesn’t put certs in /ssl folder which is why you get the error and why I don’t know how it ever worked.
If you use 443 for ssl then you don’t need to specify it in the base_url.
I don’t use 443 because as Tinkerer says, when everyone front door is in the same place and yours isn’t, it just extra obscurity and you will have far less people knocking on it.
If you do decide to do that, forward xxxxx to 443 and in your caddyfile with the url just put :xxxxx at the end. eg xxx.duckdns.org:xxxxx
Ive been tearing my hair out for days now with no luck getting this to work. I use my own domain through loopia and pointed A to my public ip adress. If I open 8123 -> 8123 i can access HA from autiside using my-own.domain.se:8123. So there shouldnt be a problem with the pointing.