I have two VM's. One running LEMP and one running grafana.
I have configured nginx on LEMP to serve as a reverse proxy for various VMs in my lab including the VM with grafana.
It works great, but i would like to add Let's Encrypt SSL on the grafana host from outside, so grafana.mydomain.com is served on SSL.
I want to set up wildcard for *.mydomain.com so that in the future i can deploy new services and VMs that can be access via HTTPS from the outside. Is there a common practice on doing this? I'm not sure if i should install certbot and deploy certificate on the nginx host or on the vm running grafana. I tried both, and both failed. Altho i'm not sure if i missed a few settings on the grafana config f.ex. I can't find any guides that seem to provide the correct config setup afaik.
Currently i have tried installing SSL on both nginx reverse proxy host and grafana host for wildcard *.mydomain.com, which also adds to my confusion because it's now "doubled-up" with certs.
certs are stored under /etc/letsencrypt/live/mydomain.com
Not sure what else is relevant for information. But here is the nginx config stored under /etc/nginx/sites-enabled/grafana.mydomain.com:
server {
server_name grafana.mydomain.com;
# ssl on;
# ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://10.0.0.113:3000;
}
}
Note. I have commented out the SSL settings, as i am unable to reach grafana with this enabled when accessing from the outside.
SSL was deployed on nginx host with this command:
$ sudo certbot certonly --manual -d *.mydomain.com --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory
In short words - Am i right that certbot and LE should be deployed on the nginx host. And no need for it on the backend host(grafana)? My guess is that the uncommented version of the nginx config posted above should work, but i'm missing some configsettings elsewhere.