Set X-Forwarded-For only for requests from Cloudflare
This commit is contained in:
parent
f7d13e1cf0
commit
4bf5e8f63a
1 changed files with 5 additions and 0 deletions
|
@ -47,6 +47,11 @@ frontend web
|
|||
http-request set-header X-Url-Scheme https
|
||||
http-request set-header Host %[ssl_fc_sni]
|
||||
|
||||
# Set X-Forwarded-For only for requests from Cloudflare
|
||||
acl from_cf src -f /usr/local/etc/haproxy/cloudflare_ips.lst
|
||||
acl cf_ip_hdr req.hdr(CF-Connecting-IP) -m found
|
||||
http-request set-header X-Forwarded-For %[req.hdr(CF-Connecting-IP)] if from_cf cf_ip_hdr
|
||||
|
||||
# CORS
|
||||
http-response set-header Access-Control-Allow-Origin "*"
|
||||
http-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization, JSNLog-RequestId, activityId, applicationId, applicationUserId, channelId, senderId, sessionId"
|
||||
|
|
Loading…
Add table
Reference in a new issue