소스 검색

Add X-Forwarded-For as well

master
Chris Smith 5 년 전
부모
커밋
d51a7521ff
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2
    1
      templates/haproxy.cfg.tpl

+ 2
- 1
templates/haproxy.cfg.tpl 파일 보기

@@ -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…
취소
저장