Feature request to "access_log" directive

Fabiano Furtado Pessoa Coelho fusca14 at gmail.com
Mon Apr 4 19:28:54 UTC 2022


Sorry to bother you with this feature request. I believe you software
engineers already thought about it and there are a million reasons to
not implement it.

Well, I'm exactly in this situation described here
I want to use "try_files" and log the access within the location with
"try_files" directive...

    location /my_system {
      access_log /var/log/nginx/my_system_access.log;
      try_files $uri @named_loc;
    location @named_loc {
        access_log off;
        proxy_pass http://...;

... and I can't! "Requests are logged in the context of a location
where processing ends. It may be different from the original location,
if an internal redirect happens during request processing."
I can make it work using the "#include" directive and removing the
named location, but using "try_files" is more clean and sophisticated.

Is there a way to include the "now" directive to "access_log"?
Something like: "access_log /var/log/nginx/my_system_access.log now;"

Thanks in advance.

More information about the nginx mailing list