# What \`log\_format\` directives mean?

**URL:** <https://community.nginx.org/t/what-log-format-directives-mean/7550>\
**Category:** NGINX\
**Tags:** logging\
**Created:** [October 14, 2025, 11:41am UTC](https://community.nginx.org/t/what-log-format-directives-mean/7550 "2025-10-14T11:41:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuS2rUQ1FXSkG1W](https://avatars.discourse-cdn.com/v4/letter/y/eada6e/32.png) [@YuS2rUQ1FXSkG1W](https://community.nginx.org/u/YuS2rUQ1FXSkG1W)\
**Post date:** [October 14, 2025, 11:41am UTC](https://community.nginx.org/t/what-log-format-directives-mean/7550/1 "2025-10-14T11:41:25Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![alessandro](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/alessandro/32/4836_2.png) [@alessandro](https://community.nginx.org/u/alessandro)\
**Post date:** [October 14, 2025, 12:55pm UTC](https://community.nginx.org/t/what-log-format-directives-mean/7550/2 "2025-10-14T12:55:23Z")

</div>

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:

- [`upstream_addr`](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#variables)
- [`remote_addr`](https://nginx.org/en/docs/http/ngx_http_core_module.html#variables)

`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.

---

<div class="post-metadata">

**Author:** ![YuS2rUQ1FXSkG1W](https://avatars.discourse-cdn.com/v4/letter/y/eada6e/32.png) [@YuS2rUQ1FXSkG1W](https://community.nginx.org/u/YuS2rUQ1FXSkG1W)\
**Post date:** [October 14, 2025, 1:26pm UTC](https://community.nginx.org/t/what-log-format-directives-mean/7550/3 "2025-10-14T13:26:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/system/32/19_2.png) [@system](https://community.nginx.org/u/system)\
**Post date:** [November 13, 2025, 1:26pm UTC](https://community.nginx.org/t/what-log-format-directives-mean/7550/4 "2025-11-13T13:26:38Z")

</div>

Closed on November 13, 2025, 1:26pm UTC

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