| Post Reply | RetroFed Forums Forum Index » Selfhosted |
| Author | Message | ||
|---|---|---|---|
|
samuraiapocalypse
lemmy.zip
samuraiapocalypse@lemmy.zip Joined: 2025-06-29 |
Hello! I have 2 services that are only being accessed locally but require HTTPS so I am using Caddy & DuckDNS w/ DNS-01 to reverse proxy them. In DuckDNS, both subdomains are pointing at the local IP address of Caddy, and my Caddyfile has:
The issue is that I can access https://service1.duckdns.org/ (within my home network), but I can't access https://service2.duckdns.org/ (502 Bad Gateway). Caddy is running in a LXC in Proxmox, and Service1 is on a different VM on the same Proxmox machine, while Service2 is on a different machine on my network. I don't see any entries in my router's firewall logs or PiHole that indicates something is blocking it. I enabled logging in Caddy for both services and I am only able to see activity for Service1, so I guess that means something is blocking Service2 from reaching Caddy entirely? I'm able to access service2 directly from the IP address but I'm a novice in networking so I'm trying to understand and learn what could be causing this. Any help would be appreciated! Edit: service2 is ActualBudget and I had configured it to use the certs using the instructions here (https://actualbudget.org/docs/config/https/) when I didn't need to (since Caddy handles all of this already.. i think) |
||
| 25 Original | |||
|
hendrik
palaver.p3x.de
hendrik@palaver.p3x.de Joined: 2021-08-21 |
I'd say there's likely something wrong with your service. Maybe it refuses serving on a domain it's not configured for? Or there's something wrong with the headers or something like that. Or the internal network. Anyway, the 502 error is sent by the Caddy server. That means everything from your browser to the Caddy server should be fine. You can reach it. There's something wrong with the service or the parts in-between the reverse proxy and the application. |
||
| 7 | |||
|
surewhynotlem
lemmy.world
surewhynotlem@lemmy.world Joined: 2023-06-13 |
Take out the entry for service1 first to simplify the problem. But from what I can see it looks right. Does service 2 have a self signed ssl certificate? If yes you'll need a TLS setting in that caddy block to ignore validation. |
||
| 4 | |||
|
surewhynotlem
lemmy.world
surewhynotlem@lemmy.world Joined: 2023-06-13 |
Also do an nslookup on the service 2 host name. Make sure it's going to the right IP |
||
| 1 | |||
James R Kirk
startrek.website
Kirk@startrek.websiteJoined: 2025-03-01 |
Have you tried NGINX proxy manager? It really simplifies the whole process. |
||
| -2 | |||
|
grorbabrag
lemmy.world
grorbabrag@lemmy.world Joined: 2023-06-19 |
Seems weird that you're not seeing any logs for service2 in caddy, especially if it's caddy serving the 502. I'd expect at least a message from caddy complaining about being unable to reach the upstream service in that case. Verify that the 502 is coming from caddy and not potentially some other gateway that's part of service2. |
||
| 3 | |||
|
nibbler
discuss.tchncs.de
nibbler@discuss.tchncs.de Joined: 2025-03-07 |
tcpdump -nlpiany port 8080 Will show if caddy actually tries to connect the back end. |
||
| 1 | |||
|
samuraiapocalypse
lemmy.zip
samuraiapocalypse@lemmy.zip Joined: 2025-06-29 |
Seems weird that you're not seeing any logs for service2 in caddy, especially if it's caddy serving the 502. I'd expect at least a message from caddy complaining about being unable to reach the upstream service in that case. Verify that the 502 is coming from caddy and not potentially some other gateway that's part of service2.
OK, I noticed I had service1.duckdns.org --> Caddy IP configured in my local DNS for pihole, but didn't have an entry for service2. I added service2.duckdns.org --> Caddy IP. Not exactly sure how that works but now I can see errors in the logs for it in Caddy, and it's still sending me a 502. I'm not really sure where to start troubleshooting based on the log entry:
|
||
| 3 | |||
|
samuraiapocalypse
lemmy.zip
samuraiapocalypse@lemmy.zip Joined: 2025-06-29 |
Take out the entry for service1 first to simplify the problem. But from what I can see it looks right. Does service 2 have a self signed ssl certificate? If yes you'll need a TLS setting in that caddy block to ignore validation.
I don't think it's self-signed.. I used Caddy to generate the certs and copied them over into the config for the service. The service2 that I'm unable to access is ActualBudget and I followed their instructions from their docs (https://actualbudget.org/docs/config/https) |
||
| 1 | |||
|
grorbabrag
lemmy.world
grorbabrag@lemmy.world Joined: 2023-06-19 |
OK, I noticed I had service1.duckdns.org --> Caddy IP configured in my local DNS for pihole, but didn't have an entry for service2. I added service2.duckdns.org --> Caddy IP. Not exactly sure how that works but now I can see errors in the logs for it in Caddy, and it's still sending me a 502. I'm not really sure where to start troubleshooting based on the log entry: {"level":"error","ts":...
Yea, no, that log entry doesn't really shed any light on the issue. However, your comment regarding having configured ActualBudget to serve the certificate might be hinting at what's wrong. Since your chain is You'll likely want/need to configure actualBudget to trust your proxy as well https://actualbudget.org/docs/config/#trustedproxies |
||
| 4 | |||
|
dimjim
sh.itjust.works
dimjim@sh.itjust.works Joined: 2023-10-15 |
I'd say there's likely something wrong with your service. Maybe it refuses serving on a domain it's not configured for? Or there's something wrong with the headers or something like that. Or the internal network. Anyway, the 502 error is sent by the Caddy server. That means everything from your browser to the Caddy server should be fine. You can reach it. There's something wrong with the servic...
This is the right approach, I’ve had several services require extra bits in the caddy config such as:
I would do a search for “your service & caddy”, someone probably has ran into the same issue. |
||
| 2 | |||
|
surewhynotlem
lemmy.world
surewhynotlem@lemmy.world Joined: 2023-06-13 |
I don't think it's self-signed.. I used Caddy to generate the certs and copied them over into the config for the service. The service2 that I'm unable to access is ActualBudget and I followed their instructions from their docs (https://actualbudget.org/docs/config/https)
Missing some settings then |
||
| 1 | |||
|
HoodedBandit
lemmy.zip
HoodedBandit@lemmy.zip Joined: 2026-10-01 |
This is the right approach, I’ve had several services require extra bits in the caddy config such as: reverse_proxy 192.168.50.6:8006 { transport http { tls_insecure_skip_verify } } I would do a search for “your service & caddy”, someone probably has ran into the same issue.
FWIW, here is my ActualBudget Caddy config.
|
||
| 2 | |||
|
dimjim
sh.itjust.works
dimjim@sh.itjust.works Joined: 2023-10-15 |
FWIW, here is my ActualBudget Caddy config. budget.example.com { reverse_proxy actual-server:5006 { header_down -Access-Control-Allow-Origin header_down Cross-Origin-Opener-Policy same-origin header_down Cross-Origin-Embedder-Policy credentialless } }
I’ve never used ActualBudget, but their docs have a slightly different caddy example config:
|
||
| 2 | |||
|
HoodedBandit
lemmy.zip
HoodedBandit@lemmy.zip Joined: 2026-10-01 |
I’ve never used ActualBudget, but their docs have a slightly different caddy example config: budget.example.org { encode gzip zstd reverse_proxy actual_server:5006 }```
Yep, just sharing what worked for me |
||
| 1 | |||
|
dimjim
sh.itjust.works
dimjim@sh.itjust.works Joined: 2023-10-15 |
Yep, just sharing what worked for me
Lmao sorry for the confusion, I wasn’t paying attention and thought you were OP, wasn’t trying to correct you! |
||
| 2 | |||
|
samuraiapocalypse
lemmy.zip
samuraiapocalypse@lemmy.zip Joined: 2025-06-29 |
Yea, no, that log entry doesn't really shed any light on the issue. However, your comment regarding having configured ActualBudget to serve the certificate might be hinting at what's wrong. Since your chain is client > caddy > actual you should be following the guide by actualbudget regarding operating behind a reverse proxy, so actual should not be serving the certificate. You'll likely ...
Thanks for the explanation! I removed the entries for the certs in Actual and now it seems to be working. Solved a problem and learned something new! |
||
| 2 | |||
|
grorbabrag
lemmy.world
grorbabrag@lemmy.world Joined: 2023-06-19 |
Thanks for the explanation! I removed the entries for the certs in Actual and now it seems to be working. Solved a problem and learned something new!
Sweet, just keep in mind that the connection between caddy and actual is just a plain HTTP one. |
||
| 1 | |||
| Post Reply |
Back to top |