What `log_format` directives mean?

My log_format allows to store such fields at logs:

upstream_addr
http_x_forwarded_for
remote_addr

All of them have the same addresses in many cases.
What field will contain the real IP address I need to monitor I can block in case of a problem?
What are the differences between them in simple words and why there’re three exactly same fields value?

Hi @YuS2rUQ1FXSkG1W!

I would suggest looking at our docs since they do a better job than I would explaining what each NGINX specific variables does:

http_x_forwarded_for is a standard HTTP header but it might not always be present.

Some or all of these variables might have the same value depending on your environment and where incoming client connections to NGINX are coming from.

I see that remote_addr (according logs I have) have always value. And sometime its value equals to the most-known ‘white’ IP addresses.

Looks like remote_addr is what I’m searching for.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.