id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,uname,nginx_version 1051,Problem with access_log whose names contain variables!,chenjianbin@…,," When we configure access_log directive contain variables (like this: access_log /data0/logs/nginx/$Site.access.log main_debug;) and if a request meet some conditions and uri will be rewritten to others, then this request will not be logged to access logfile. Look at following example '''Here are the details of the configuration''' server{ set $Site www.test.com; listen 80; server_name www.test.com test.com; index index.php index.html index.htm; root /data0/web/$Site; location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; } } location ~ .+\.php($|/) { fastcgi_pass unix:/dev/shm/php-cgi-$Site.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; } access_log /data0/logs/nginx/$Site.access.log main_debug; } For exmaple, nginx handles a http request like http://www.test.com/aaaa ,if web root directory doesn't have aaaa file or aaaa directory,then the request uri will be rewritten and pass to PHP. whatever status code that PHP return to nginx and nginx return to user. this request can't be logged to access logfile. so if access_log directive contain variables and request rewritten,then request will not be logged. I want to use access_log directive with variables to convenient configuration and I also need to log all request, so I don't know how to do? My English is so bad, I don't know if you know what I mean.",defect,closed,major,,other,1.8.x,worksforme,access_log variables,,Linux localhost.localdomain 3.10.0-327.13.1.el7.x86_64 #1 SMP Thu Mar 31 16:04:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux,"nginx version: nginx/1.8.1 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013 TLS SNI support enabled configure arguments: --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-md5=/usr/lib --with-sha1=/usr/lib --with-http_gzip_static_module --with-http_stub_status_module --with-http_realip_module --with-debug"