<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                這是一個ngx_http_module_t類型的靜態變量。這個變量實際上是提供一組回調函數指針,這些函數有在創建存儲配置信息的對象的函數,也有在創建前和創建后會調用的函數。這些函數都將被nginx在合適的時間進行調用。 [](http:// "點擊提交Issue,反饋你的意見...") typedef struct { ngx_int_t (*preconfiguration)(ngx_conf_t *cf); ngx_int_t (*postconfiguration)(ngx_conf_t *cf); void *(*create_main_conf)(ngx_conf_t *cf); char *(*init_main_conf)(ngx_conf_t *cf, void *conf); void *(*create_srv_conf)(ngx_conf_t *cf); char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev, void *conf); void *(*create_loc_conf)(ngx_conf_t *cf); char *(*merge_loc_conf)(ngx_conf_t *cf, void *prev, void *conf); } ngx_http_module_t; <table class="docutils field-list" frame="void" rules="none" style="margin: 0px -0.5em; border: 0px; color: rgb(0, 0, 0); font-family: 'segoe UI', sans-serif; letter-spacing: -0.1599999964237213px; line-height: 24px; white-space: normal; background-color: rgb(255, 255, 255);"><colgroup><col class="field-name"/><col class="field-body"/></colgroup><tbody valign="top"><tr class="field-odd field"><th class="field-name" colspan="2" style="padding: 1px 8px 1px 5px; border: 0px !important;">preconfiguration:</th></tr><tr class="field-odd field"><td style="padding: 1px 8px 1px 5px; border: 0px !important;">?</td><td class="field-body" style="padding: 1px 8px 1px 5px; border: 0px !important;">在創建和讀取該模塊的配置信息之前被調用。</td></tr><tr class="field-even field"><th class="field-name" colspan="2" style="padding: 1px 8px 1px 5px; border: 0px !important;">postconfiguration:</th></tr><tr class="field-even field"><td style="padding: 1px 8px 1px 5px; border: 0px !important;">?</td><td class="field-body" style="padding: 1px 8px 1px 5px; border: 0px !important;">在創建和讀取該模塊的配置信息之后被調用。</td></tr><tr class="field-odd field"><th class="field-name" colspan="2" style="padding: 1px 8px 1px 5px; border: 0px !important;">create_main_conf:</th></tr><tr class="field-odd field"><td style="padding: 1px 8px 1px 5px; border: 0px !important;">?</td><td class="field-body" style="padding: 1px 8px 1px 5px; border: 0px !important;">調用該函數創建本模塊位于http block的配置信息存儲結構。該函數成功的時候,返回創建的配置對象。失敗的話,返回NULL。</td></tr><tr class="field-even field"><th class="field-name" style="padding: 1px 8px 1px 5px; border: 0px !important;">init_main_conf:</th><td class="field-body" style="padding: 1px 8px 1px 5px; border: 0px !important;">調用該函數初始化本模塊位于http block的配置信息存儲結構。該函數成功的時候,返回NGX_CONF_OK。失敗的話,返回NGX_CONF_ERROR或錯誤字符串。</td></tr><tr class="field-odd field"><th class="field-name" colspan="2" style="padding: 1px 8px 1px 5px; border: 0px !important;">create_srv_conf:</th></tr><tr class="field-odd field"><td style="padding: 1px 8px 1px 5px; border: 0px !important;"/><td class="field-body" style="padding: 1px 8px 1px 5px; border: 0px !important;">調用該函數創建本模塊位于http server block的配置信息存儲結構,每個server block會創建一個。該函數成功的時候,返回創建的配置對象。失敗的話,返回NULL。</td></tr><tr class="field-even field"><th class="field-name" style="padding: 1px 8px 1px 5px; border: 0px !important;">merge_srv_conf:</th><td class="field-body" style="padding: 1px 8px 1px 5px; border: 0px !important;">因為有些配置指令既可以出現在http block,也可以出現在http server block中。那么遇到這種情況,每個server都會有自己存儲結構來存儲該server的配置,但是在這種情況下http block中的配置與server block中的配置信息發生沖突的時候,就需要調用此函數進行合并,該函數并非必須提供,當預計到絕對不會發生需要合并的情況的時候,就無需提供。當然為了安全起見還是建議提供。該函數執行成功的時候,返回NGX_CONF_OK。失敗的話,返回NGX_CONF_ERROR或錯誤字符串。</td></tr><tr class="field-odd field"><th class="field-name" colspan="2" style="padding: 1px 8px 1px 5px; border: 0px !important;">create_loc_conf:</th></tr><tr class="field-odd field"><td style="padding: 1px 8px 1px 5px; border: 0px !important;">?</td><td class="field-body" style="padding: 1px 8px 1px 5px; border: 0px !important;">調用該函數創建本模塊位于location block的配置信息存儲結構。每個在配置中指明的location創建一個。該函數執行成功,返回創建的配置對象。失敗的話,返回NULL。</td></tr><tr class="field-even field"><th class="field-name" style="padding: 1px 8px 1px 5px; border: 0px !important;">merge_loc_conf:</th><td class="field-body" style="padding: 1px 8px 1px 5px; border: 0px !important;">與merge_srv_conf類似,這個也是進行配置值合并的地方。該函數成功的時候,返回NGX_CONF_OK。失敗的話,返回NGX_CONF_ERROR或錯誤字符串。</td></tr></tbody></table> Nginx里面的配置信息都是上下一層層的嵌套的,對于具體某個location的話,對于同一個配置,如果當前層次沒有定義,那么就使用上層的配置,否則使用當前層次的配置。 這些配置信息一般默認都應該設為一個未初始化的值,針對這個需求,Nginx定義了一系列的宏定義來代表各種配置所對應數據類型的未初始化值,如下: #define NGX_CONF_UNSET ? ? ? -1 #define NGX_CONF_UNSET_UINT ?(ngx_uint_t) -1 #define NGX_CONF_UNSET_PTR ? (void *) -1 #define NGX_CONF_UNSET_SIZE ?(size_t) -1 #define NGX_CONF_UNSET_MSEC ?(ngx_msec_t) -1 又因為對于配置項的合并,邏輯都類似,也就是前面已經說過的,如果在本層次已經配置了,也就是配置項的值已經被讀取進來了(那么這些配置項的值就不會等于上面已經定義的那些UNSET的值),就使用本層次的值作為定義合并的結果,否則,使用上層的值,如果上層的值也是這些UNSET類的值,那就賦值為默認值,否則就使用上層的值作為合并的結果。對于這樣類似的操作,Nginx定義了一些宏操作來做這些事情,我們來看其中一個的定義。 #define ngx_conf_merge_uint_value(conf, prev, default) ? ? ? ? ? ? ? ? ? ? ? \ ? ?if (conf == NGX_CONF_UNSET_UINT) { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ ? ? ? ?conf = (prev == NGX_CONF_UNSET_UINT) ? default : prev; ? ? ? ? ? ? ? \ ? ?} 顯而易見,這個邏輯確實比較簡單,所以其它的宏定義也類似,我們就列具其中的一部分吧。 [](http:// "點擊提交Issue,反饋你的意見...") ngx_conf_merge_valuengx_conf_merge_ptr_valuengx_conf_merge_uint_valuengx_conf_merge_msec_valuengx_conf_merge_sec_value 等等。 下面來看一下hello模塊的模塊上下文的定義,加深一下印象。 [](http:// "點擊提交Issue,反饋你的意見...") static ngx_http_module_t ngx_http_hello_module_ctx = { NULL, /* preconfiguration */ ngx_http_hello_init, /* postconfiguration */ NULL, /* create main configuration */ NULL, /* init main configuration */ NULL, /* create server configuration */ NULL, /* merge server configuration */ ngx_http_hello_create_loc_conf, /* create location configuration */ NULL /* merge location configuration */ }; **注意:這里并沒有提供merge_loc_conf函數,因為我們這個模塊的配置指令已經確定只出現在NGX_HTTP_LOC_CONF中這一個層次上,不會發生需要合并的情況。**
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看