How to debug NginX? 如何调试NginX

来源:互联网 发布:欧阳娜娜 黑料 知乎 编辑:程序博客网 时间:2024/06/06 14:12

You need to build nginx with the option: --with-debug.
Then in nginx.conf, you should write
    error_log  logs/error.log debug;
And you should set
    master_process  off;
    daemon          off;
in nginx.conf to simplify debugging.
Then load some pages to test, and look up the logs/error.log for what happen.

如果需要调试Nginx,你需要增加--with-debug选项重新编译一个Nginx。

同时,nginx.conf 如下配置:
    error_log  logs/error.log debug; # 只记录调试日志

你需要设置:
    master_process  off; # 简化调试 此指令不得用于生产环境
    daemon          off; # 简化调试 此指令可以用到生产环境

然后加载一些页面做测试,察看 logs/error.log 发生了什么。

原创粉丝点击