Closed Znuff closed 10 months ago
Hi @Znuff ,
I agree that it would be nice to include this by default. But the implementation depends on the environment. The value for set_real_ip_from
needs to match the networking setup. So there's no default that works for everyone (and doesn't create a security risk).
Though it would be nice to mention this in the README.md so people can find this directive easily. Do you mind making a PR for this? Otherwise I'll do this myself.
I've added it to the documentation: https://github.com/TrafeX/docker-php-nginx/blob/master/docs/real-ip-behind-loadbalancer.md
Sometimes this image may be used behind another reverse proxy, or even behind Cloudflare.
It would be nice to have the ability to make use of the real IP address of the visitor.
http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_header