Caddy and multiple APIS SSL error reddit / selfhosted ---------------------------------------------------------------------- cefasheli · 2023-10-06 15:21 i have my website running in node/eletron [campanhasdoboi.com.br](https://www.campanhasdoboi.com.br) and it has a SSL certification provides by caddy the conf file under /etc/caddy/CaddyFiles is \# A CONFIG SECTION FOR YOUR HOSTNAME [campanhasdoboi.com.br](https://campanhasdoboi.com.br) { \# PROXY ALL REQUEST TO PORT 30000 reverse\_proxy localhost:30000 } And it's working fine! But i have a second API running in this address [campanhasdoboi.com.br:25000/api/data](https://campanhasdoboi.com.br:2 5000/api/data) and it's not getting the SSL certifications. Could someone givem some guidance on this question? ---------------------------------------------------------------------- KMFMS · 2023-10-06 21:26 From what you've provided it is most likely due to the fact that Caddy is listening for `campanhasdoboi.com.br` and not `campanhasdoboi.com.br:25000`. Try updating your Caddyfile as below and test: campanhasdoboi.com.br { # PROXY ALL REQUEST TO PORT 30000 reverse_proxy localhost:30000 } campanhasdoboi.com.br:25000 { # Assuming this is also on localhost. Adjust accordingly reverse_proxy localhost:25000 } Make sure you have port 25000 forwarded to the correct endpoint if traversing a firewall and that the device is listening on that port. Also, not 100% the same but very similar issue you can look to for reference: [https://caddy.community/t/multiple-sites-with-same-domain- and-different-ports/13752](https://caddy.community/t/multiple-sites- with-same-domain-and-different-ports/13752) Hope that helps! ---------------------------------------------------------------------- cefasheli · 2023-10-07 02:32 > campanhasdoboi.com.br { \# PROXY ALL REQUEST TO PORT 30000 reverse\_proxy localhost:30000 } campanhasdoboi.com.br:25000 { \# Assuming this is also on localhost. Adjust accordingly reverse\_proxy localhost:25000 } It was my first try, when i do it i get an error when i try to run de API. Error: listen EADDRINUSE: address already in use :::25000 curious at least... I tried to remove the port from de api, but nothing. i follow that thread, my firewall is configurated. thanks in advance for all the help so far ---------------------------------------------------------------------- KMFMS · 2023-10-07 19:30 `Error: listen EADDRINUSE: address already in use :::25000` tells me caddy and endpoints are on the same computer. Is that accurate? If so, you will need to update your firewall configuration to have port 25000 point to Caddy instead of the host. Alternatively, you could use a subdomain and drop the need to specify the port: ``` campanhasdoboi.com.br { # PROXY ALL REQUEST TO PORT 30000 reverse_proxy localhost:30000 } api.campanhasdoboi.com.br { # Assuming this is also on localhost. Adjust accordingly reverse_proxy localhost:25000/api/data } ``` Just remember that you will need to create this DNS entry (typically a CNAME record pointing to the A record for `campanhasdoboi.com.br` will do the trick) for the subdomain to work. ---------------------------------------------------------------------- cefasheli · 2023-10-07 20:56 I think what really need here is understand how this technology works instead to trying make it works only. I will try your suggestion! Thanks again!