Debug Nginx with debug information

Source: Internet
Author: User
Keywords Debug nginx information debugging
Tags access aliyun configuration debug debugging default error.log file

If you need to debug nginx carefully, you need to see its http://www.aliyun.com/zixun/aggregation/10818.html >debug information. This information is not recorded by default, and the following methods show you how to view the information.

Debug only one connection and modify the Nginx configuration file to:
Error_log/var/log/nginx/errors;
Events {
Debug_connection 192.168.1.1;
}

Set Error_log to output debug information

Syntax:error_log file [Debug | info | notice | warn | error | crit]
Default: ${prefix}/logs/error.log

Compile nginx with this option: –with-debug, you can see the debug information, configure the output format:

Error_log LOGFILE [Debug_core | debug_alloc | debug_mutex | debug_event
| Debug_http | DEBUG_IMAP];

Log_format access ' $remote _addr– $remote _user [$time _local] ' $request '
' $status $body _bytes_sent $http _referer '
' $http _user_agent ' $http _x_forwarded_for ';
Access_log/var/log/nginx/access.log access;

OK, restart Nginx, you can access the page, to debug.

From Nginx Chinese web: http://www.nginx.com.cn/?p=354

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.