location ~ ^/test/(?<id>\d+)$ {
postgres_pass database;
rds_json on;
postgres_escape $name $id;
postgres_query "SELECT $name";
}
上面的代码片段取自https://github.com/FRiCKLE/ngx_postgres/issues/4。
有人可以向我解释 ^ 的作用和 $ 的作用吗?我找不到解释它的文档。已经检查了https://github.com/FRiCKLE/ngx_postgres和http://nginx.org/en/docs/http/ngx_http_core_module.html#location。