Faild to use reverse proxy Grafana via Nginx

Hello eveyone!

I am having some problems when using reverse proxy. It always response Unable to connect when I access from browser.

Nginx Configuration File:
server {
listen 3000 ssl;
#root /usr/share/nginx/html;
#index index.html index.htm;

ssl_certificate /etc/grafana/GEMNPRD1ELK4.crt;
ssl_certificate_key /etc/grafana/GEMNPRD1ELK4.key;

location / {
proxy_pass https://localhost:8080/;

access_log  /var/log/nginx/access_grafana.log;
error_log /var/log/nginx/error_grafana.log;


location /api/live {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;
proxy_set_header Host $http_host;
proxy_pass https://localhost:8080/;

Error.log File:
connect() failed (111 connection refused) while connecting to upstream client

I need help to fix this issue.


1 Like

I’m guessing this government URL might have something to do with your troubles.

All, here is a good troubleshooting guide for NGINX:

Did you configure Grafana to run on port 8080? The default is 3000, so if your Grafana is running on the default settings the proxy line should read:

proxy_pass http://localhost:3000/

You have nginx listening to port 3000 - normal SSL listens at 443 - so not sure if you got confused on the ports, or that’s something unique to your service/gov etc.

whatever port you have Grafana served on, do a curl request to validate it’s working. Then move on to fixing nginx.

Thanks @mattabrams . I need to edit my topic but I can’t do this. Please advise.

hmmm, that’s strange. Maybe just add a new response to the thread with any news or updates :+1: