NGINX 调试

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值