1. The problem I’m having:
Hello, I’m running a couple a service in my home lab and recently I had the need to expose them to be accessed from outside. My whole home network goes through Mullvad VPN which is installed in my router running OpenWRT. Mullvad alllows me to get some ports from their server (e.g. port 54996), which I can then use to access my services through mullvad-server-outgoing-ip:mullvad-port. I cannot have access to default external ports (443/80) because Mullvad generate random one for me, always with numbers 5000+.
Accessing “mullvad-server-outgoing-ip:mullvad-port” would lead to my OpenWRT router, which then port forwards this request to my server within the LAN in any port that I want.
I have a domain and managed to get a valid certificate using Mullvad server IP by runing cerbot and addind a DNS record for _acme-challenge. But I can’t seem to use this certificate.
Can I access my services through my VPN, using my domain, with non-default ports and get valid SSL?
2. Error messages and/or full log output:
There are no error messages, I just can’t get SSL to work. Caddy itself doesn’t throw errors.
3. Caddy version:
v2.6.4
4. How I installed and ran Caddy:
apt install caddy
systemctl start caddy
a. System environment:
Ubuntu Server 22.04
b. Command:
My problem isn’t associated with any specific command.
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
d. My complete Caddy config:
{
http_port 54995
https_port 55426
}
my-url.com {
reverse_proxy localhost:8096
}