Reverse Proxy Configuration

Hey all, I have Grafana running on my server with ip 1.1.1.1 and port 3000. I have a url, test.graf.net, pointing to the ip. By setting up the Grafana config like this, I am able to successfully access Grafana through the browser:

# Protocol (http, https, socket)
protocol = https

# The ip address to bind to, empty will bind to all interfaces
http_addr = 1.1.1.1

# The http port  to use
http_port = 3000

# The public facing domain name used to access grafana from a browser
domain = test.graf

# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
root_url = https://test.graf.net:3000

This works perfectly when I try to access using the https://1.1.1.1:3000 or https://test.graf.net:3000, but the problem comes in when I have an Apache Reverse proxy https://dash.organization.net/dash pointing to https://test.graf.net:3000. I either get an internal server error, or some other error occurs.

Here is my Apache conf file:

<VirtualHost *:80>
    ServerName dash.organization.net
    RewriteEngine On
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>

<VirtualHost *:443>
    SSLEngine On
    SSLCertificateKeyFile {{key_dir}}
    SSLCertificateFile {{cert_dir}}
    ServerName dash.organization.net
    ProxyPass /dash "https://test.graf.net:3000"
    ProxyPassReverse /dash "https://test.graf.net:3000"
</VirtualHost>

I was assuming with this redirect, I should be able to access the Grafana page by going to https://dash.organization.net/dash but this does not seem to be the case

*The IPs and URLs have been changed for the purpose of this post

Hi,

Have you read the Running Grafana behind a reverse proxy documentation?

What version of Grafana are you using?
Do you see any errors in Grafana server logs?

If you try and re-configure Grafana to default settings. Then change the following in Grafana:

domain = dash.organization.net

And then in your apache conf proxy to the http://:3000 instead, does that work better?

Marcus

Would you be able, please, to provide a section with Grafana proxy configuration via apache? Is it expected, that when you providing subpath (i.e. /grafana), static files still serves from the root /public, instead of /grafana/public?

Hi,

my company has configured proxy in our LAN settings.
if i could send notification mails without proxy and connecting to my own internet source,
when i connect internet through proxy, I can’t send ratification mails. It stamps

t=2018-09-26T14:35:27+0530 lvl=eror msg=“Failed to send alert notification email” logger=alerting.notifier.email error=“dial tcp 74.125.133.109:587: i/o timeout”
t=2018-09-26T14:35:31+0530 lvl=eror msg=“Failed to send alert notification email” logger=alerting.notifier.email error=“dial tcp 74.125.133.109:587: i/o timeout”
t=2018-09-26T14:35:31+0530 lvl=eror msg=“Failed to send alert notifications” logger=context userId=1 orgId=1 uname=admin error=“dial tcp 74.125.133.109:587: i/o timeout”
t=2018-09-26T14:35:31+0530 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alert-notifications/test status=500 remote_addr=[::1] time_ms=10033 size=48 referer=http://localhost:8080/alerting/notification/1/edit

how i can set up reverse proxy to resolve this??

Were you able to get this working. I’m trying to figure the same issue out and I did as you originally did.

Please ask your proxy administrator to check the rules:

  1. The grafana server ip as the origin of the rule
  2. port 587 as destination of the rule

or the simple one:

  1. allow all request from grafana server ip to external network in the proxy rule

Regards,
Fadjar Tandabawana