How to debug NginX? 如何调试NginX

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 发生了什么。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章