# "Missing remote\_user in NGINX logs with Nextcloud and LDAP authentication"

**URL:** <https://help.nextcloud.com/t/missing-remote-user-in-nginx-logs-with-nextcloud-and-ldap-authentication/209712>\
**Category:** ℹ️ Support\
**Tags:** nextcloud, php, php82, nginx, nc27, ldap\
**Created:** [November 12, 2024, 7:50am UTC](https://help.nextcloud.com/t/missing-remote-user-in-nginx-logs-with-nextcloud-and-ldap-authentication/209712 "2024-11-12T07:50:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![slava](https://help.nextcloud.com/letter_avatar/slava/32/6_449c533f586939b6e5f246632a46421f.png) [@slava](https://help.nextcloud.com/u/slava)\
**Post date:** [November 12, 2024, 7:50am UTC](https://help.nextcloud.com/t/missing-remote-user-in-nginx-logs-with-nextcloud-and-ldap-authentication/209712/1 "2024-11-12T07:50:45Z")

</div>

Hello everyone,

I have a Nextcloud server running version 27.1.11 on Ubuntu 22.04, with NGINX version 1.18.0 (Ubuntu) and PHP 8.2-FPM. Authentication is set up through LDAP.

My question is about the NGINX logs: I’m not seeing the `remote_user` field, even though this parameter is specified in the `log_format` directive in `nginx.conf`. When I check `/phpinfo.php`, both `$_SERVER['HTTP_X_REMOTE_USER']` and `$_SERVER['REMOTE_USER']` show as `no value`.

How can I fix this so that `remote_user` appears correctly?

Thanks in advance for any help!

Nginx log\_format:

```auto
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

```

The output nginxlog in `/var/log/ ____ `:

```auto
10.1.1.8 - - [12/Nov/2024:10:39:52 +0300] "GET /apps/files/api/v1/stats HTTP/1.1" 200 267 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36" 10.1.1.28

```

---

<div class="post-metadata">

**Author:** ![mritzmann](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mritzmann/32/43763_2.png) [@mritzmann](https://help.nextcloud.com/u/mritzmann)\
**Post date:** [November 12, 2024, 8:04am UTC](https://help.nextcloud.com/t/missing-remote-user-in-nginx-logs-with-nextcloud-and-ldap-authentication/209712/2 "2024-11-12T08:04:29Z")

</div>

Isn’t `$remote_user` only for basic authentification?

---

<div class="post-metadata">

**Author:** ![slava](https://help.nextcloud.com/letter_avatar/slava/32/6_449c533f586939b6e5f246632a46421f.png) [@slava](https://help.nextcloud.com/u/slava)\
**Post date:** [November 12, 2024, 8:37am UTC](https://help.nextcloud.com/t/missing-remote-user-in-nginx-logs-with-nextcloud-and-ldap-authentication/209712/3 "2024-11-12T08:37:49Z")

</div>

We initially set up authentication through LDAP, and for a while, logging worked correctly — user information appeared in the NGINX logs. However, now the user data is missing from the logs.

I’d appreciate any ideas on what might have caused this issue and how to restore proper logging.

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [February 10, 2025, 8:38am UTC](https://help.nextcloud.com/t/missing-remote-user-in-nginx-logs-with-nextcloud-and-ldap-authentication/209712/4 "2025-02-10T08:38:38Z")

</div>

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