NGINX 调试

来源:互联网 发布:论述题生成软件 编辑:程序博客网 时间:2024/06/05 18:59

NGINX 调试

配置

ERROR 级别:debug

前提是编译时加入 ./configure --with-debug选项

然后 error_log path_to_log error;

debug_connection

如果在高并发情况下只对某一IP地址的连接访问进行debug日志输出,则可以这样:

events {    debug_connection 192.168.0.106;}

官方解释:
http://nginx.org/en/docs/ngx_core_module.html#debug_connection

使用master/worker方式工作

配置:

master_process on/off; //default on

off配置可以关闭master_process 的工作方式,master进程不会fork出worker进程,而是自己处理请求,可便于调试。

指定core_dump 文件存储位置以及大小

配置:

Syntax: working_directory directory;Default: Context:    main

Defines the current working directory for a worker process. It is primarily used when writing a core-file, (主要指定core文件的目录。)in which case a worker process should have write permission for the specified directory.

Syntax: worker_rlimit_core size;Default: Context:    main

Changes the limit on the largest size of a core file (RLIMIT_CORE) for worker processes(限制core文件的大小). Used to increase the limit without restarting the main process

守护进程方式运行NGINX

daemon on/off; //default on

daemon on ,指定nginx后台运行。off 直接输出到标准输出。

详细看官方文档:http://nginx.org/en/docs/ngx_core_module.html

0 0
原创粉丝点击