
'$status $body_bytes_sent "$http_referer" ' In the configuration file /etc/nginx/nf you will need to change the entries: log_format main '$remote_addr - $remote_user "$request" ' This option can be implemented whether or not the -with-http_realip_module was specified at compilation, and modifies the format for the access_log directive to include the X-Forwarded-For Header contents.

Option 1 - Altering the log directive format

You can check if the module was included by running the following command: nginx -V and reviewing the output. Which method you might use depends whether the NGINX binary was compiled with the option -with-http_realip_module. With NGINX, there are two ways the service can be modified to use the X-Forwarded-For Header. How do you configure NGINX to use the X-Forwarded-For Header? Or you can use HAProxy (our preference): option forwardfor NGINX can also be used as the load balancer of course: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for All you need to do is slighty modify the logging directive in the web server configuration (to tell it to use the header). With, when you create a Layer 7 HTTP mode VIP configuration, the X-Forwarded-For Header is enabled by default.
#Nginx reverse proxy domain masking hide real ip download
Download Now: Evolving Approaches to Application Delivery Personally, I think that by far the easiest option when load balancing a website/web application is to use the X-Forwarded-For Header.

It is simply an orders of magnitude larger problem to network and debug a set of intertwined distributed services versus a single monolithic application. As on the ground microservice practitioners quickly realize, the majority of operational problems that arise when moving to a distributed architecture are ultimately grounded in two areas: networking and observability.
