Issue with Caddy

Hi Claudio,
i am using the version 0.10.10-2 from bestlibre. i tried to install also the version 1.3 using your adapted setting but i got the same effect. i have to do some additional setting in the router? i have just forwarded port 80 and 443.

Thx
Alessandro

Anything in the log?
Have you registered with duckdns.org?

I am using noip services instead duckdns. The displayed in the web page of the addon didn’t show any error. Does Caddy generate a log file in some repository?

I don’t know where, but it should.

You may want to try duckdns.org just to give you some additional clues. It takes you few minutes. Once run caddy, wait some time (like 15 minutes) and then see if it works

Probably being thick but I don’t get what Caddy adds, thought it was an alternative to services like duckDNS but @anon35356645 is using it with it so obviously not. Can someone give me an explanation in idiot’s terms as even their website doesn’t make it obvious?

I installed it, run it, and it was working … to this day I tried around 20 times with nginx and still not 100% working …

It is an alternative to letsencrypt + nginx (you still need duckdns for assigning your static IP, and, I think, with caddy is then easy to haveautomatically the certificates and those bla bla bla).

So you need caddy+duckdns (easy to install)
or
letsencrypt+nginx+dickdns (difficult to install and update with additional forwards)

Oooookaaay… just to show my total ignorance, why would I want nginx?

have a look at this picture from professor @ReneTode

but I recommend you Caddy instead of nginx

1 Like

Gotcha, thanks @anon35356645, that makes it obvious :slight_smile:

Don’t think I’ve got anything that would benefit yet, the built in internal comms in hassio takes care of what I do use, but will definitely give Caddy a go as and when.

thx, but i dont have a degree :wink:
so if you use my name then please do it without such obvious …

@Bobby_Nobble its very usefull to use a proxyserver (doesnt matter if thats nginx, caddy or another) as gate between your outside network and inside network.

its usefull, for alexa skills, dashboards, or any other kind of communication between home assistant and other programs.

Honoris causa cum laude, in appdaemon and such

OK, thought I was there :blush: , can you explain more re Alexa skills so i have something I can relate to, as they will still communicate over the LAN it’s not like you can remove the router from the equation as your diagram suggests?

you need a router, because that is what gets an outside IP address from your provider.
1 IP address normally, not 2 or more.
so from the outside you only have 1 443 port, because your router only can use every port only once.

on the inside you have home assistant (thats a server) and perhaps HADashboard (thats a server) maybe FTP (a server) for your cams, your IP cams (are also servers) some local programming for alexa (for instance through appdaemon API, also a server) and there many more programs that are servers.
all those things that you want to reach from the outside, but you want all the data to be save.
so actually you would like to be able to have several 443 ports. but you cant have that.

so what to do about that?

all incoming data comes to your (save) 443 port from your router.
the router sends all that data to your proxy server
your proxy server decides what to do with that data.
for instance you could create 2 different duckns names and both send everything to your outside IP.

your router doesnt know the difference and sends everything to your proxyserver.
the proxyserver looks at the name that is used.
if it is name A it sends the data to home assistant
if it is name B it sends it to your dashboard
if after name A the url has /appdaemon/api/ in it it sends it to the appdaemon API server
if the url has FTP in it it sends it to your FTP server.

alexa needs a https address if you want a skill with local programming.
you could use the home assistant server for that (thats why HA with letsencrypt installed can work)
but then you cant use your 443 port for nothing else anymore (no cams that can be reached from the outside with https for instance)

hope this makes it clear for you.

1 Like

I tried also duckdns but i got the same effect. I double check also the port forwarding on my router and it seems ok. DO you have any additional idea on which could be the root cause of my issue it’s like the proxy not works…how can i test it?

Thanks, makes a lot more sense. I guess I’ve been lucky that nothing currently needs that and with the duckDNS domains I use I specify the port I want to talk to on the inside in the url so all the forwarding I’ve needed so far has been similar to WAN 8123 to LAN device 8123 etc. Using the domain alone to talk to a specific internal port is attractive though so I may give this a go sooner rather than later.

most people that are busy with home automating sooner or later come to a point where they need to go this way.
everyone that uses HADashboard for example is better of using that way.
i see lots of people coming by that connect their appdaemon or their dashboard to their duckdns address.
most of them dont realise that when the internet goes down, also their automations in appdaemon or dashboards go down.
Who wants that? :wink:

if you only use home assistant and from the outside and you dont want to connect other programs to home assistant, then there is little need for a proxy server. but most people come to a point where they add stuff, and more and more and more :wink:

i never used caddy, but if claudio says that easy, then it probably is, so when you come to that point i would say go with that.

2 Likes

I have huge difficulties in understanding how it all works (because I did not understand it in the first place).

Some thoughts, but PLEASE take my suggestions as you would get suggestions from a blind man before crossing a road :stuck_out_tongue:
did you disable the other Caddy addon?
do you have other services at port 80 (maybe affects the caddy service?)
do you have nginx also enabled (disable it)
did you put in duckdns.org the correct name (the same you use in Caddyfile configuration file)

Do you have this in your /HASSIOCONFIG/DIRECTORY/Share/caddy/Caddyfile (replace the xxx with the na,e you put in the duckdns.org website) and replace 192.168.1.12 with the STATIC IP address of your HASSIO installation

https://xxx.duckdns.org {
tls /ssl/fullchain.pem /ssl/privkey.pem {
alpn http/1.1
}
proxy / 192.168.1.12:8123 {
transparent
websocket
}
log stdout
errors stderr
}

In /HASSIOCONFIG/DIRECTORY/ssl/
do you have fullchain and privkey files?

just to make sure you should have

80 ----> 80 to the IP of your hassio installation
443 ----> 443 to the IP of your hassio installation

I use BOTH for both 80 and 443 (because I never remember if I should use TCP or UDP)

Don’t be shy :slight_smile:

Yes I did. The duckdns work correctly if i point to my router but doesn’t work on port 80 and 443.

xxx.duckdns.org:(router_port) it’s display the router login

i tried also to do a direct port forwarding of the port 8123 and it’s work! How can I double check the feature of the reverse proxy?