nginx http_core模組 設定檔解析 2

來源:互聯網
上載者:User

上一篇講述了設定檔的整體結構,下面重點分析htt_core模組的配置資訊結構,得到如下的一幅圖:

從上面很明顯可以看出需要合并的ngx_http_core_srv_conf_t、ngx_http_core_loc_conf_t結構體。但是ngx_http_merge_locations代碼中有:

for (q = ngx_queue_head(locations);         q != ngx_queue_sentinel(locations);         q = ngx_queue_next(q))    {        lq = (ngx_http_location_queue_t *) q;        clcf = lq->exact ? lq->exact : lq->inclusive;//遍曆得到loc_conf_t        ctx->loc_conf = clcf->loc_conf;        rv = module->merge_loc_conf(cf, loc_conf[ctx_index],//當前server塊的loc_conf數組                                    clcf->loc_conf[ctx_index]);// == clcf ?(當前server塊下的某個location塊資訊)        if (rv != NGX_CONF_OK) {            return rv;        }        rv = ngx_http_merge_locations(cf, clcf->locations, clcf->loc_conf,//location 下面還有location麼?                                      module, ctx_index);        if (rv != NGX_CONF_OK) {            return rv;        }    }

第二個ngx_http_merge_locations 很明顯是合并location下面的ngx_http_core_loc_conf_t結構體,難道location下面還可以再加location? 這是一個疑問。

於是去網上找資料,有: http://tech.uc.cn/?p=300

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.