How do I set https to a server redirected from siteground?

Hello, I'm pretty much dumb on DNS, SSL/TLS ecc… But here is what I would like to do.

I have a website (mywebsite.it) hosted on Siteground and everything is fine, but I would like to redirect the traffic from a subdomain of it (service.mysite.it) to a linode server. I managed to add an A record within Siteground DNS settings that points to my linode server IP.
This actually works because if I try to access or if I ping service.mysite.it it redirects me to my linode server but it is not an https connection anymore!
To complicate things I would like to mange the server with docker and nginx as reverse proxy.

Can someone help me on how to enable secure connection?

Do I have to import some kind of zone into linode? Do I have to manage somehow certbot with docker? Is it all Siteground business because the DNS zone is in its nameservers? I don't understand

1 Reply

DNS is basically magic and can cause a lot of problems when misconfigured, so don't beat yourself up over this too much!

Okay, so as you've described (and what is necessary) is to have two independent A Records; one pointed towards your primary domain name, the second pointed towards your subdomain. Although your primary domain sounds like it already has a successfully created and applied SSL cert, the subdomain (which points to the same IP address) does not.

This is why using either primary or subdomain will navigate to your site, but only the primary address will be HTTPS secured. You have two main ways to manage this, both of which you've already alluded to in your post.


One way would be to install NGINX (or Apache2) and CertBot right on your server and manually manage your reverse proxy and SSL certs. First, you would configure NGINX Reverse Proxies or Apache Virtual Hosts (slightly different syntax, same function). Once the subdomain has it's proxy/virtual host configured, you would then install and run CertBot to generate an SSL cert.


What fun would it be to install apps right on the server without leveraging a Docker app that does exactly what you want. NGINX Proxy Manager (NPM) is a Docker app that provides a UI that allows you to create/manage reverse proxies and SSL certs within the same action.

When the NPM container is deployed, it creates a local Docker network nginxproxymanager_default that you would then reference within other Docker-Compose.yml files. For a rough general idea of how you would integrate NPM into your compose:

version: 'X'
services:
  $APP_NAME:
    container_name: $NAME_YOUR_CONTAINER
    ### CONTAINER SPECS GO HERE
    ports:
      - '$PORT:$PORT'
    networks:
      - nginxproxymanager_default
    ## ANY OTHER CONTAINER SPECS ALSO GO HERE
    ...

networks:
  nginxproxymanager_default:
    external: true

For more information about NGINX Proxy Manager, I recommend checking out their main project page:


Do I have to import some kind of zone into linode? Is it all Siteground business because the DNS zone is in its nameservers?

Where you host the domain records isn't as important as how you manage them. If you have purchased a domain through a registrar with a competent/easy to use DNS interface, go ahead and keep using it. If you feel that the Linode Cloud Manager provides easier ways to manage your DNS records in conjunction with your Linode servers, do that instead. Essentially, you need to make sure that if you use Cloud Manager, you must point your domain nameservers to Linode's nameservers.


I hope this steers you well, good luck with your applications and welcome into the great journey that is DNS!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct