Home > Operation and Maintenance > Nginx > How to turn off the log function in nginx

How to turn off the log function in nginx

王林
Release: 2020-08-20 16:50:01
forward
10307 people have browsed it

How to turn off the log function in nginx

nginx Turn off the log; in fact, one way is to write the /dev/null file or set it to turn off.

(Recommended tutorial: nginx tutorial)

nginx logs have two types:

access.log http records access logs.

error.log server operation record log

1. Close http record access log

access_log off;
Copy after login

or

access_log /dev/null;
Copy after login

2. Close Server operation log:

error_log /dev/null;
Copy after login

Clear the log of the occupying program;

nginx or tomcat or other occupying program clear the log;

cat /dev/null > test.log
或
echo " " > test.log
Copy after login

Direct rm deletion will cause the space not to be released ;

ps -ef|grep delete
kill -9 pid
Copy after login

The above is the detailed content of How to turn off the log function in nginx. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Error restarting nginx
From 1970-01-01 08:00:00
0
0
0
server - Nginx configuration webapp problem
From 1970-01-01 08:00:00
0
0
0
Nginx default.conf problem
From 1970-01-01 08:00:00
0
0
0
centos7 - NGINX exception occurs
From 1970-01-01 08:00:00
0
0
0
nginx load balancing
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template