Caddy configuration problem

hi all, I installed caddy in a docker container and followed this guide:

This is my caddyfile:

(https_header) {
  header {
    Strict-Transport-Security "max-age=31536000; includeSubdomains"
    X-XSS-Protection "1; mode=block"
    X-Content-Type-Options "nosniff"
    X-Frame-Options "SAMEORIGIN"
    Referrer-Policy "same-origin"
  }
}

https://my.duckdns.org { 
  respond "Saluti dal Crew inDomus"
  file_server
}
https://my.duckdns.org:9000 { 
  import https_header
  reverse_proxy http://LOCAL_IP:8123
  @ws: {
    header Connection "Upgrade"
    header Upgrade websocket
  }
}

Everything works with home assistant: from wan I connect to my HA server by https://my.duckdns.org:9000.
But now I have a problem with zoneminder, by the link http://my.duckdns.org:8080 (the port 8080 is forwarded to my zoneminder server) I have the error: “This Site Can’t Be Reached”

suggestions?

Nothing there shows that port 8080 is involved with Caddy at all

You are right, have I to add a configuration?

If you want Caddy to handle remote access to ZoneMinder, then the obvious answer is yes - how else will it work?

I’d like that caddy hadle zoneminder but I don’t know how to configure caddy.
Zoneminder in lan works with “localip:8080”, in the wan works with “publicip:8080”.
But if I use my.duckdns.org:8080 (my.duckdns.org is configured in caddy) zoneminder doesn’t works.
I created a secondo domain and with “my2.duckdns.org:8080” zoneminder works. It seems that caddy checks the 8080 port but it isn’t configured…

Where did you forward port 8080 to? To use Caddy that has to be forwarded to Caddy.

Then you have to have a Caddy section for ZM, same as you’ve done for HA (but for port 8080).

If Caddy and ZM are on the same host then you need to forward a different port to Caddy.

now I forward the 8080 to the zoneminder server, so I need to add to the caddyfile:

https://my.duckdns.org:9001 { 
  import https_header
  reverse_proxy http://LOCAL_IP_ZONEMINDER:8080
  @ws: {
    header Connection "Upgrade"
    header Upgrade websocket
  }
}

Caddy and ZM have different ip…

Then Caddy isn’t involved in connections to Zoneminder

You (now) need to forward 9001 to Caddy

Caddy isn’t involved in connections to Zoneminder, but from the wan the link to zoneminder http://my.duckdns.org:8080/ doesn’t work and I don’ know why…

  1. Did you forward 8080 to ZM?
  2. What’s in ZM’s logs?

Oh, and as the problem appears to be entirely related to ZM, why not ask at https://forums.zoneminder.com/?