SSL behind NAT

My virtualmin setup is behind a natted connection. I've got a 1:1 nat configured from the WAN ip assigned to the server to the LAN ip that is configured on the ethernet adapter on the server.

I have Virtualmin configured to use the wan ip in all dns records. This seems to be working fine. My problem occured when I started using SSL with LetEncrypt. Virtualmin creates a new apache vhost but then uses the wan ip to create the vhost. This breaks apache and doesn't allow it to bind to the right ip address on port 443 for the ssl host.

Is there a way that I can automate the creation of SSL websites so that I don't have to go in and manually edit the vhost to use the LAN ip? Or can I tell it to use the following type of config by default as this seems to work - using * in the virtualhost parameter.


SuexecUserGroup "#1001" "#1001"
ServerName domain.tld
Status: 
Active

Comments

I'm pretty sure I've got this sorted out.

Howdy -- that's great!

I'll offer that if you haven't already, you may want to take a peek at System Settings -> Virtualmin Config -> Network Settings, and make sure that "Default virtual server IPv4 address" is set to the network interface, and "Default IP address for DNS records" is set to "Automatically detected external address".

Those two options should help when behind NAT.

Thanks! That's the route I took. I happened to find the answer in the forums after creating the ticket. It just took a bit more digging.

That's great then, glad to hear it's working for you.

Feel free to let us know if you have any additional questions!