My nginx backend server should only accept requests from my frontend, 1.2.3.4. However, I also want nginx to log the correct IP address, so I use set_real_ip_from. But by doing this, the allow rule in the config isn't matched, and nginx will always return a 403. Here's the relevant config:
allow 1.2.3.4;
deny all;
set_real_ip_from 1.2.3.4;
real_ip_heaader X-Real-IP;
How can I overcome this problem?