瀏覽代碼

docs: Add haproxy example for running behind reverse-proxy

Tobias Svehagen 8 年之前
父節點
當前提交
f129754a96
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      docs/sources/installation/behind_proxy.md

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

@@ -68,6 +68,23 @@ server {
   }
 }
 ```
+
+#### HAProxy configuration with sub path
+```bash
+frontend http-in
+  bind *:80
+  use_backend grafana_backend if { path /grafana } or { path_beg /grafana/ }
+
+backend grafana_backend
+  # Requires haproxy >= 1.6
+  http-request set-path %[path,regsub(^/grafana/?,/)]
+
+  # Works for haproxy < 1.6
+  # reqrep ^([^\ ]*\ /)grafana[/]?(.*) \1\2
+
+  server grafana localhost:3000
+```
+
 ### IIS URL Rewrite Rule (Windows) with Subpath
 
 IIS requires that the URL Rewrite module is installed.