access_log is valid in location context, so you can write nginx.conf like this: location /name/ { access_log name.log; } Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279535,279544#msg-279544