post_main_config
在 Nginx 主配置块的末尾追加指令,位于 http {} 块之后。
语法
--- post_main_config 段的内容会被追加到生成的 nginx.conf 的最末尾,在 http {} 块之后。这在需要配置 stream 等与 http 平级的块时特别有用。
perl
1=== TEST 1: stream block2--- post_main_config3 stream {4 server {5 listen 1985;6 return "hello from stream\n";7 }8 }9--- config10 location /t {11 echo "ok";12 }13--- request14GET /t15--- response_body16okpost_main_config 常用于配合 stream 模块测试,因为 stream 块必须与 http 块同级。