Sharing some notes on how I got my grafana subdomain to work with the reverse proxy in lets encrypt. Hopefully this helps someone with a similar setup. I am simply a journeyman when it comes to nginx, encryption, and docker so take my cobbling with a grain of salt and make sure you back up your .conf files before you screw around!
I have the grafana container created by grafana, and the letsencrypt container from linuxserver both in the same proxy network I set up.
For most of my other subdomains the proxy works fine with the conf line :
proxy_pass http://$upstream_[app]:[port];
However; for whatever reason that did not work with Grafana for me. I commented out the proxy pass conf line and changed it to the following, where the ip is the internal ip for unraid:
proxy_pass http://192.168.1.20:3000;
I changed the settings for the Grafana container and change my GF_SERVER_ROOT_URL to:
https://[mydomain].com
Of course, I added grafana to letsencrypt subdomain list.
An additional configuration I added to all of my subdomain .conf files to force http to https was a new server block as follows:
server {
listen 80 ;
listen [::]:80 ;
server_name [subdomain].*;
return 301 https://$host$request_uri;
}
So now inside and outside my network going to grafana.[mydomain].com sends me to the Grafana login page.