Подскажите почему не работает access_log off в локации? Если пишу в секции server, то работает, но я хочу отключить логи только для определённых файлов. Вот мой конфиг:
server {
listen 80;
server_name .site.com.ua;
access_log /var/log/nginx/site.com.ua_access.log;
error_log /var/log/nginx/site.com.ua_error.log;
root /var/www/citysites/site.com.ua/htdocs;
index index.html index.htm index.php;
if ($host = 'www.site.com.ua' ) {
rewrite ^/(.*)$ http://site.com.ua/$1 permanent;
}
location ~* \.(js|jpeg|jpg|gif|png|swf)$ {
access_log off;
expires max;
}
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}