Can I get Nginx to log certain types of requests differently?
-
21-08-2019 - |
Question
I want Nginx to log requests that start with /path to a certain log file. like this:
- http://domain.com/path/to/dir = Logged
- http://www.domain.com/to/some/dir/path/ = Not Logged
- http://sub.domain.com/ = Not Logged
Sorry if this is vague, but I'm new to the nginx config biz. Feel free to ask questions about what I'm doing, I'll answer them the best I can.
Solution
location /foobar {
access_log /var/log/foobar.log;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow