# Reverse proxy does not write access-log as expected

**URL:** <https://community.nginx.org/t/reverse-proxy-does-not-write-access-log-as-expected/8958>\
**Category:** General Discussion\
**Tags:** reverse-proxy, config\
**Created:** [February 3, 2026, 5:33pm UTC](https://community.nginx.org/t/reverse-proxy-does-not-write-access-log-as-expected/8958 "2026-02-03T17:33:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisCross](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@ChrisCross](https://community.nginx.org/u/ChrisCross)\
**Post date:** [February 3, 2026, 5:33pm UTC](https://community.nginx.org/t/reverse-proxy-does-not-write-access-log-as-expected/8958/1 "2026-02-03T17:33:06Z")

</div>

I’m using `nginx/1.22.1` as a reverse proxy and like to make the proxy log into different files. I’v a longish `/etc/nginx/sites-available/default` with quite a few different `access_log`-settings. Most of them do work perfectly fine and do write different access-logs. But there is one server driving me crazy and not writing its own log. I expected to read requests to `dav.kidding.com` in `/var/log/nginx/access-radicale.log` but do find these requests in `/var/log/nginx/access-kidding.com.log`

`default` starts like this:

```auto
server {
    listen 80;
    server_name dav.kidding.com;
    access_log /var/log/nginx/access-radicale.log;

    add_header Proxy local;
    location / {
        proxy_pass http://192.168.178.42:5232;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        # https://stackoverflow.com/questions/62664348/cant-get-clients-real-ip-when-using-nginx-reverse-proxy
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Remote-User $remote_user;
    }
    client_max_body_size 40M;
}

server {
  listen 80;
  server_name kidding.com;
  access_log /var/log/nginx/access-kidding.com.log;

  add_header Proxy local;
  location / {
    proxy_pass http://192.168.178.42:8008;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    # https://stackoverflow.com/questions/62664348/cant-get-clients-real-ip-when-using-nginx-reverse-proxy
    proxy_set_header X-Real-IP $remote_addr;
  }
  client_max_body_size 40M;
}

```

nginx seems to ignore first `access_log` while anything else from that section apparently is accepped and works well. Can anybody give me a hint how I can make nginx write `/var/log/nginx/access-radicale.log`?

On [stackoverflow](https://stackoverflow.com/questions/79882093/nginx-does-not-write-different-access-logs-as-expected) I was told to be off topic with this but the guess there was that the first server `dav.kidding.com` might not be loaded at all. So I changed `nginx.conf` according to [this](https://nginx.org/en/docs/debugging_log.html) and added `error_log /var/log/nginx/error.log debug;`

From what I find in `error.log` `dav.kidding.com` _is_ loaded and operating (no complaints logged) but still `/var/log/nginx/access-radicale.log` is missing. How to get that written?

---

<div class="post-metadata">

**Author:** ![ChrisCross](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@ChrisCross](https://community.nginx.org/u/ChrisCross)\
**Post date:** [February 3, 2026, 9:03pm UTC](https://community.nginx.org/t/reverse-proxy-does-not-write-access-log-as-expected/8958/2 "2026-02-03T21:03:08Z")

</div>

OK, it all works as it should if one edits the correct config. Symlinks are pretty tricky. Autsch!

---

<div class="post-metadata">

**Author:** ![buulam](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/buulam/32/3733_2.png) [@buulam](https://community.nginx.org/u/buulam)\
**Post date:** [February 5, 2026, 3:00am UTC](https://community.nginx.org/t/reverse-proxy-does-not-write-access-log-as-expected/8958/3 "2026-02-05T03:00:25Z")

</div>

Thanks for the follow up @ChrisCross !
