Nginx does not log unwanted access logs

Source: Internet
Author: User

Nginx does not log unwanted access logs


Nginx does not record the log pointing to the elements of the site, why do you need to do so, under what circumstances need to do this:

When calculating the log PV, generally do not need to statistics picture element of the log, because, open a Web page is a PV, when the RS server does not want to record

A useless log from the front-end that balances health checks.

Case

The following is a configuration of resources that do not record access to pictures

Location ~. *\. (gif|jpg|jpeg|png|bmp|swf) $

{

Expires 365d;

Access_log off;

}

Location ~. *\. (JS|CSS)? $

{

Expires 90d;

Access_log off;

}

Access_log/application/nginx/logs/access.log access;


Nginx does not log unwanted access logs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.