Nginx Access_log completely off nginx disable Access.log nginx empty access.log nginx Delete Access.lo

Source: Internet
Author: User
Recently, when configuring the local Nginx development environment, a problem was found when the server segment did not specify Access_log, and no Access_log parameter was specified in the HTTP segment, and it was written to logs/by default. Access.log this file, which is the Access_log default value, is "Logs/access.log" and is the access log for all servers. However, I did not find the default value for this configuration on the Nginx website.
If we don't need to, add a line access_log off in the HTTP segment, and then configure the logs that you want to write in the specific server. Development environment I do not write the log by default, that is, do not configure any access_log, only open when needed.
In the Nginx HTTP segment, set access log:

Log_format  main  ' $remote _addr-$remote _user [$time _local] "$request" "$status                      $body _bytes_sent" $http _ Referer "                      " "$http _user_agent" "$http _x_forwarded_for" '; Log_format  gzip  ' $remote _addr-$remote _user [$ Time_local] "$request"                      $status $bytes _sent "$http _referer" "                      $http _user_agent" "$gzip _ratio"; log_ Format Download  ' $remote _addr-$remote _user [$time _local] "$request" "$status $bytes                      _sent" $http _referer "" $ Http_user_agent "                      " "$http _range" "$sent _http_content_range"; #access_log  logs/access.log  main; Access_log off;

The above describes the Nginx Access_log completely closed, including the access,nginx aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.