DEV Community 👩‍💻👨‍💻

Korakrit Chariyasathian
Korakrit Chariyasathian

Posted on

Grafana (MySQL) + Nginx reverse proxy

  1. Git clone from korakrit-c/grafana-with-nginx-on-docker.git

    git clone https://github.com/korakrit-c/grafana-with-nginx-on-docker.git
    
  2. Make sure you can run docker-compose then starting it

    docker-compose up -d
    
  3. Create a new config file on "nginx-revers-storage/conf.d/"

    cd nginx-revers-storage/conf.d/
    nano grafana.conf
    
  4. Add this config

    upstream grafana_dashboard {
      server    grafana_dashboard:3000;
    }
    server {
        listen 80;
        listen [::]:80;
        server_name grafana.local;
        location / {
            proxy_pass http://grafana_dashboard;
        }
    }
    
  5. Restart nginx

    docker exec nginx_reverse nginx -s reload
    

Top comments (1)

Collapse
 
ncblx profile image
Emin Aliyev

Thanks for post.
Could you please clarify where should be created grafana.conf file?
I tried to create it on root dir with compose file. bit its not work.

[root@localhost grafana-with-nginx-on-docker]$ ll
total 8
drwxrwxr-x. 2 ealiyev ealiyev 26 Jan 7 11:58 conf.d
-rw-rw-r--. 1 ealiyev ealiyev 2620 Jan 7 11:58 docker-compose.yml
drwxrwxr-x. 3 ealiyev ealiyev 20 Jan 7 12:10 nginx-revers-storage
-rw-rw-r--. 1 ealiyev ealiyev 418 Jan 7 11:58 README.md

🌚 Life is too short to browse without dark mode