nginx.conf中的location段中的?<id>是什么意思?

这个问号表示它将作为变量 foo 在 ngx_postgres 中可访问吗?

我只需要确认一下。 https://github.com/FRiCKLE/ngx_postgres#sample-configuration-5

这是纯粹的 ngx_postgres 函数还是也适用于 nginx 独立版?

点赞
用户1058509
用户1058509

这是 nginx 标准的命名捕获正则表达式功能:

例如:

有了这个位置:

location ~ /numbers/(?<num>\d+) {
 # 我捕获了一个或多个数字到变量 $num 
   ...
}

如果请求是 /numbers/100

变量 $num (值为 100) 将在您的位置中可用。

2015-09-28 18:22:56