Configuration items for debugging and locating problems
Whether to run Nginx in daemon mode
Syntax: daemon on|off
Default: daemon on
Function: A daemon process is a process that can leave the terminal and run in the background. The purpose of his separation is to prevent information during the execution of the process from being printed on the terminal. In this way, the process will not be interrupted by any information generated by the terminal. By default, the daemon process is enabled.
However, for debugging purposes, it can be turned off.
Whether to work in master/worker mode
Syntax: master_process on|off
Default: master_process on
Function: Nginx runs in a way that the master process manages multiple worker processes. In almost all product environments, Nginx will work in this way.
To facilitate debugging, it can be turned off. In this way, the worker child process will not be forked to handle the request.
Error log settings
Syntax: error_log /path/file level
Default: error_log /logs/error.log error
Function: The error log is the best tool for Nginx to locate problems. We can set the path and level of the log according to our own needs.
/path/file is a specific file; it can also be /dev/null, so that no log will be generated, which is the only way to turn off error_log; it can also be stderr, so that the log will be output to standard error output
level is the log level; debug, info, notice, warn, error, crit, alert, emerg, increasing from left to right.
Whether to handle several special debugging points
Syntax: debug_points [stop|abort]
Function: This configuration is used to help users debug Nginx. It receives 2 parameters: stop and abort. Nginx sets debugging points in some critical error logic. If set to stop, the SIGSTOP signal will be issued when Nginx code is executed to these debugging points. If aborted, a coredump file will be generated.
This configuration item is usually not used.
Only output debug level logs to the specified user
Syntax: debug_connection [ip|CIDR]
Function: This configuration item actually belongs to the event class, so it must be placed in events to be effective
Limit the size of the coredump core dump file
Syntax: worker_rlimit_core size;
Specify the directory generated by coredump
Syntax: worker_directory path
Please ensure that the Nginx process has permission to access this directory.
The above introduces the debugging configuration of nginx configuration, including nginx content. I hope it will be helpful to friends who are interested in PHP tutorials.