﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
2181	Custom access log is not working when error occurs.	pandey.brbhushan@…		"Hi,

I want to do custom logging. When I have URI containing “A”( as shown in example config below).


Example: 
http{
…..
access.log /var/log/nginx/access.log main;
error.log  /var/log/nginx/error.log warn;
….

server{
….
location ~ A {

access.log /var/log/nginx/custom_access.log main;
error.log  /var/log/nginx/custom_error.log warn;
                                    }
}                               

Problem:
When an API error occurs, it doesn’t log to custom_access.log. however entry is done in default access.log 

Nginx version: observed on both 1.16.1 and 1.20.0
OS Version : Ubuntu 18.04 

(Both cases have “A” in them and goes into location)
Case 1: When the request doesn’t contain error:- access log will go to custom_access.log (expected behavior)
Case 2: When the request has error:- error log will go to custom_error.log AND access log to (default) access.log instead of custom_access.log. 


How do I fix this?
"	defect	closed	major		nginx-core	1.19.x	invalid			Ubuntu 18.04 64 bit	1.16.1 and 1.20.0
