Tuesday, March 14, 2017

Grafana Nginx Proxy with MySQL

I have a Laravel Application which connects to Grafana. I have Nginx web server infront of them to act also as a reverse proxy for Grafana. Laravel is connected to MySQL for user authentication.

For setting up basic Nginx Reverse proxy for grafana, I see that this is what needs to be done.

location /grafana/ {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;

    proxy_set_header X-WEBAUTH-USER $remote_user;
    proxy_pass                 http://127.0.0.1:3000/;
}

But my authentication is being done by MySQL. So how do I make grafana/nginx talk to MySQL for authentication so that nginx does the reverse proxy for me?

My question is, what should do instead of placing "/etc/nginx/.htpasswd"?



via JMeter Dude

Advertisement