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
     mode    http
21
     mode    http
22
     bind    :443 ssl strict-sni alpn h2,http/1.1 crt /certs/
22
     bind    :443 ssl strict-sni alpn h2,http/1.1 crt /certs/
23
     bind    :80
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
     redirect scheme https code 301 if !{ ssl_fc }
26
     redirect scheme https code 301 if !{ ssl_fc }
25
     http-response set-header Strict-Transport-Security max-age=15768000
27
     http-response set-header Strict-Transport-Security max-age=15768000
26
-    http-request set-header X-Forwarded-Proto https if { ssl_fc }
27
 {{- range .Hostnames }}
28
 {{- range .Hostnames }}
28
     use_backend {{ .Name | replace "." "_" }} if { hdr(host) -i {{ .Name }}
29
     use_backend {{ .Name | replace "." "_" }} if { hdr(host) -i {{ .Name }}
29
         {{- range $san, $_ := .Alternatives }} || hdr(host) -i {{ $san }} {{- end }} }
30
         {{- range $san, $_ := .Alternatives }} || hdr(host) -i {{ $san }} {{- end }} }

Loading…
Cancel
Save