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 發生了什麼。