Browse Source

Add X-Forwarded-For as well

master
Chris Smith 5 years ago
parent
commit
d51a7521ff
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      templates/haproxy.cfg.tpl

+ 2
- 1
templates/haproxy.cfg.tpl View File

@@ -21,9 +21,10 @@ frontend main
21 21
     mode    http
22 22
     bind    :443 ssl strict-sni alpn h2,http/1.1 crt /certs/
23 23
     bind    :80
24
+    http-request set-header X-Forwarded-For %[src]
25
+    http-request set-header X-Forwarded-Proto https if { ssl_fc }
24 26
     redirect scheme https code 301 if !{ ssl_fc }
25 27
     http-response set-header Strict-Transport-Security max-age=15768000
26
-    http-request set-header X-Forwarded-Proto https if { ssl_fc }
27 28
 {{- range .Hostnames }}
28 29
     use_backend {{ .Name | replace "." "_" }} if { hdr(host) -i {{ .Name }}
29 30
         {{- range $san, $_ := .Alternatives }} || hdr(host) -i {{ $san }} {{- end }} }

Loading…
Cancel
Save