I'm having a setup for Magento 2 with Nginx + Varnish + SSL in ubuntu server 18.04. Now with my setup, I only get all logs in Nginx and inside Magento admin coming from same localhost IP which Varnish listens.
I want to change that.
What the best way to do it?
Using Nginx and
ngx_http_realip_module
Or reconfigure Varnish with a GeoIP module I found here:
Varnish GeoIP
For option one will this add in my Nginx conf file work?
server {
listen 8082;
set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;
<Other Server Options>
}
Do I need to change something in Magento
Nginx.conf
file?
Best Answer
to help you debug this, you can add this php file for example,
headers.php
:where you can see all the headers.
make sure you proxy pass correct header:
add remote IP variations and check headers with file above.