Преглед на файлове

docs(config): add docs for how to run grafana behind a reverse proxy

bergquist преди 9 години
родител
ревизия
811b7188c4
променени са 2 файла, в които са добавени 65 реда и са изтрити 0 реда
  1. 1 0
      docs/mkdocs.yml
  2. 64 0
      docs/sources/installation/behind_proxy.md

+ 1 - 0
docs/mkdocs.yml

@@ -42,6 +42,7 @@ pages:
 - ['installation/performance.md', 'Installation', 'Performance Tips']
 - ['installation/troubleshooting.md', 'Installation', 'Troubleshooting']
 - ['installation/migrating_to2.md', 'Installation', 'Migrating from v1.x to v2.x']
+- ['installation/behind_proxy.md', 'Installation', 'Grafana behind reverse proxy']
 
 - ['guides/basic_concepts.md', 'User Guides', 'Basic Concepts']
 - ['guides/gettingstarted.md', 'User Guides', 'Getting Started']

+ 64 - 0
docs/sources/installation/behind_proxy.md

@@ -0,0 +1,64 @@
+---
+page_title: Running Grafana behind a reverse proxy
+page_description: Guide for running Grafana behind a reverse proxy
+page_keywords: Grafana, reverse proxy, nginx, haproxy
+---
+
+# Running Grafana behind a reverse proxy
+
+It should be straight forward to get Grafana up and running behind a reverse proxy. But here are some things that you might run into. 
+
+Links and redirects will not be rendered correctly unless you set the server.domain setting. 
+```
+[server]
+domain = foo.bar
+```
+
+To use sub *path* ex `http://foo.bar/grafana` make sure to include `/grafana` in the end of root_url. 
+Otherwise Grafana will not behave correctly. See example below. 
+
+# Examples
+Here are some example configurations for running Grafana behind a reverse proxy.
+
+## Grafana configuration (ex http://foo.bar.com)
+```
+[server]
+domain = foo.bar
+```
+
+## Nginx configuration 
+```
+server {
+  listen 80;
+  root /usr/share/nginx/www;
+  index index.html index.htm;
+
+  location / {
+   proxy_pass http://localhost:3000/;
+  }
+}
+```
+
+# Examples with **sub path** (ex http://foo.bar.com/grafana)
+
+## Grafana configuration with sub path
+```
+[server]
+domain = foo.bar
+root_url = %(protocol)s://%(domain)s:/grafana
+```
+
+## Nginx configuration with sub path
+```
+server {
+  listen 80;
+  root /usr/share/nginx/www;
+  index index.html index.htm;
+
+  location /grafana/ {
+   proxy_pass http://localhost:3000/;
+  }
+}
+```
+
+