---
title: "如何调试Nginx "
author: "chembo"
date: "2011-10-13T11:58:27Z"
tags: ["debug", "nginx"]
categories: ["开源软件"]
slug: "nginx"
draft: false
lastmod: "2011-10-13T11:58:27Z"
id: 1194259
url: "https://chembo.iteye.com/blog/1194259"
---

如果需要调试Nginx，你需要增加--with-debug选项重新编译一个Nginx，同时，nginx.conf如下配置：

    error_log  logs/error.log debug; # 只记录调试日志
    master_process  off; # 简化调试 此指令不得用于生产环境
    daemon          off; # 简化调试 此指令可以用到生产环境