NginxHTTP return status code modification

Source: Internet
Author: User
: This article describes how to modify the NginxHTTP return status code. For more information about PHP tutorials, see. Because the traffic limit of limit_req is set in nginx configuration, many requests return error Code 503. to improve the user experience, the system wants to return normal Code 200 under the condition of throttling, frequently returned information:

Location/test {... limit_req z burst = 1 nodelay; error_page 503 = 200/dealwith_503? Callback = $ arg_callback;} location/dealwith_503 {set $ ret_body '{"code": "V00006", "msg": "operations are too frequent. please sit down and have a cup of tea. "} '; If ($ arg_callback! = "") {Return 200 'try {$ arg_callback ($ ret_body)} catch (e) {}';} return 200 $ ret_body ;}


The above describes how to modify the Nginx HTTP return status code, including some content. I hope my friends who are interested in the PHP Tutorial will be helpful.

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.