TrafeX/docker-php-nginx

Use `set_real_ip` and `set_real_ip_header` in the default config

Znuff opened this issue · 2 comments

Znuff commented

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

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.