Welcome! Log In Create A New Profile

Advanced

Problem with location and logging

Posted by potorisu 
Problem with location and logging
July 12, 2012 05:03AM
Hello.
I have problem with location and access_log or error_log.

What I want is:
When someone accessed to "http://example.com/abcd/", I want logging to "test.access.log"
and I want do this for all access under "abcd" directory.
also, "http://example.com/abcd/cache/" uses alias to another directory.

so I writed config.

location /abcd/ {
access_log logs/abcd.access.log main;
error_log logs/abcd.error.log error;
alias I:/Test/;
autoindex on;
expires 3d;
}

location /abcd/cache/ {
alias I:/Cache/;
}

but, when someone accessed to "http://example.com/abcd/cache/", it logged to main log file.

I readed wiki and I thought "location /abcd/" applies to all request started with "/abcd/"...

I have no clue...
Can someone expain this?
Attachments:
open | download - nginx.conf (1.1 KB)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 322
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready