Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ acl profile {
}

sub vcl_recv {
# Restore client IP from Cloudflare
if (req.http.CF-Connecting-IP) {
set req.http.X-Real-IP = req.http.CF-Connecting-IP;
} else {
set req.http.X-Real-IP = client.ip;
}

if (req.esi_level > 0) {
# ESI request should not be included in the profile.
# Instead you should profile them separately, each one
Expand All @@ -80,7 +87,7 @@ sub vcl_recv {

# If it's a Blackfire query and the client is authorized,
# just pass directly to the application.
if (req.http.X-Blackfire-Query && client.ip ~ profile) {
if (req.http.X-Blackfire-Query && std.ip(req.http.X-Real-IP, "0.0.0.0") ~ profile) {
return (pass);
}
}
Expand Down
Loading