Can I get help on Running Grafana behind a reverse proxy/IIS

I request help on Grafana configuration
I have a couple of questions:-

  1. I was trying to run Grafana behind the reverse proxy as suggested in the docs ‘https://grafana.com/docs/installation/behind_proxy/’. And I was not able to run Grafana server after completing the settings as described in the documentation. The server stops/exit automatically within seconds.

And I also tried ‘https://grafana.com/docs/tutorials/iis/’ and I am getting a 404 error, please find below screenshot

  1. Currently, I am running Grafana from bin/grafana-server.exe and when the exe window is closed(unknowingly) the chart stops working.

Is there any settings/option available to run Grafana in background in order to resolve this issue?

Looking forward for the help

Thank you,

Sony.

Hi Sony,

Did you get this working? If yes, do you mind sharing what was the issue, so that we can update the documentation? If no, could you share more details of what you’ve learned so far?

Thanks,
Marcus

Hi Marcus,

Sorry for the late reply, I have successfully implemented it. Please find below steps and reference links.

Grafana Setting UP in Windows Machine

  1. Open command prompt in nssm.exe - https://nssm.cc/download
  2. command - nssm install
  3. Select Grafana direcotory path in opened window
  4. Give name and description - optional
  5. Click OK and start service.

Ref: https://www.youtube.com/watch?v=pqDNWTlUoWU

  1. Install Microsoft Web Platform Installer
    Ref: https://www.microsoft.com/web/downloads/platform.aspx

  2. Open Web platform > search in spot light > URL Rewrite, ARR and install

  3. Create domain name - C:\Windows\System32\drivers\etc
    Eg. ’ 127.0.0.1 www.GrafanaTest.com

  4. Create web site with domain name www.GrafanaTest.com

  5. URL Rewrite > Add Rule > Inbound and outbound rules > Reverse Proxy
    And select From and Host name.

Ref: https://blogs.msdn.microsoft.com/friis/2016/08/25/iis-with-url-rewrite-as-a-reverse-proxy-part-2-dealing-with-500-52-status-codes/
11. Select URL Rewrite> View Server Variables

a. Add > HTTP_ACCEPT_ENCODING > OK. Add HTTP_X_ORIGINAL_ACCEPT_ENCODING OK
b. Select RPInboubd rule from Inbound section > Click Edit
c. Select Server Variable Section > Add new variables > Select HTTP_X_ORIGINAL_ACCEPT_ENCODING

Set value as {HTTP_ACCEPT_ENCODING}
d. Select Server Variable Section > Add new variables > Select HTTP_ACCEPT_ENCODING
Set value as ‘eee’
e. Click Apply

  1. Goto > website folder > Open Web.config Change to

  2. Goto IIS > URL rewrite> Add Rules > Outbound Rules> Blank rule
    a. Add new rule ‘RestoreAcceptEncoding’
    b. Select New PreCondition rule give name ‘NeedsRestoringAcceptEncoding’ > Regular exception , Match all
    c. Click add > Condition Input - {HTTP_X_ORIGINAL_ACCEPT_ENCODING} Pattern - .+ , Click OK

  3. Select ‘Server Variable’ from Matching scope > Give variable name ‘HTTP_ACCEPT_ENCODING’ > and pattern - ^(.*)

  4. Go to Action section > Select action type Rewrite and Value - {HTTP_X_ORIGINAL_ACCEPT_ENCODING}

Hope this helps,

Thank you.
Sony.

Hi Marcus,

I request help on this

Thanks,
Sony.

I have one more scenario like there are different Excavator users and Member users.
And when a Member user logs in he should be able to view his data only, same applies to Excavators.

For eg.

There are Member1 and Member2, When Member1 logged into the system he should 

be able to view the Dashboard with his data only. I have one column in my table with
user name data (eg. member1@gmail.com). Here ‘member1@gmail.com’ is the user name of
Member1 to log into the Dashboard.

I am using SQL Server as database.

How can I get the user name(member1@gmail.com) and apply the same as a filter condition in my query.

Thanks in advance,
Sony.