Turn off or tighten nginx errors and access records

Source: Internet
Author: User
Keywords Nginx accessing Records
Tags access accessing records aliyun configuration configure error.log host html

Web site If the flow is relatively large, then nginx recorded errors, especially the access log is very much, on the space run a few months after the full, causing the server to run abnormally.
To avoid this, you can turn off Nginx errors and access records, turn off access records individually, and filter out certain accesses that you do not need to record.

First, you can turn off access logging in the http://www.aliyun.com/zixun/aggregation/14840.html "> Virtual host configuration file:

Access_log off;

If you want to target files for certain suffixes without accessing records, you can configure:

Location ~ *\. (Js|jpg| Jpg|jpeg| Jpeg|css|bmp|gif| GIF) $
{
Access_log off;
}

If you need to turn off error handling, do not configure this:

Error_log off;

This will not really close the record, Nginx will be recorded in a file called off, does not play any role.

This configuration is required:

Error_log/dev/null;

If you just don't want to turn off record very serious errors, you can configure this:

Error_log/var/log/nginx/error_log Crit;

From Nginx Chinese web: http://www.nginx.com.cn/?p=356

Related Article

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.