This is my configuration, for my staging environment, I always get access denied because Cloudflare changes the user ip addresses , How can limit access to staging environment while using Cloudflare free edition?
listen 80;
server_name staging.example.com *.staging.example.com;
location / {
proxy_pass http://localhost:5001/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
allow 185.108.83.160; #Allow a single remote host
deny all; #Deny everyone else
}
}