读书人

稿件13:Nginx多阶段处理HTTP请求

发布时间: 2012-10-19 16:53:35 作者: rapoo

文章13:Nginx多阶段处理HTTP请求

我自己添加的注释本文讲述了HTTP请求处理阶段的内容,非常棒的一篇文章。部分重点内容翻译如下,请大家阅读。
原文http://www.nginxguts.com/2011/01/phases/。

这个颜色的字体是我翻译内容
这个颜色的字体是我自己添加的注释
这个颜色的字体当然就是原文

HTTP request processing phases in NginxPosted on January 4, 2011 by vkholodkov

稿件13:Nginx多阶段处理HTTP请求Nginx processes HTTP requests in multiple phases. In each of the phases there might be 0 or more handlers called. In the Nginx source code phases have specific constants associated with them. Here is a list of all phases:

Nginx以多个阶段(phases)处理HTTP请求。对于每个阶段可能有0个多个handler被调用。在Nginx源码中都有常量名称标识各个阶段,下面是所有阶段的列表:

  1. NGX_HTTP_SERVER_REWRITE_PHASE — the phase of request URI transformation on virtual server level;
  2. NGX_HTTP_FIND_CONFIG_PHASE — the phase of configuration location lookup;
  3. NGX_HTTP_REWRITE_PHASE — the phase of request URI transformation on location level;
  4. NGX_HTTP_POST_REWRITE_PHASE — request URI transformation post-processing phase;
  5. NGX_HTTP_PREACCESS_PHASE — access restrictions check preprocessing phase;
  6. NGX_HTTP_ACCESS_PHASE — access restrictions check phase;
  7. NGX_HTTP_POST_ACCESS_PHASE — access restrictions check post-processing phase;
  8. NGX_HTTP_TRY_FILES_PHASE — try_files directive processing phase;
  9. NGX_HTTP_CONTENT_PHASE — content generation phase;
  10. NGX_HTTP_LOG_PHASE — logging phase.

On every phase you can register any number of your handlers.Exceptions are following phases:

在每个阶段你都可以注册多个自定义的hanlders。除了下面几个阶段。

读书人网 >移动开发

热点推荐