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.