正则表达式在Nginx中不起作用

时间:2016-01-07 16:58:30

标签: nginx

我在nginx中编写正则表达式,但它不起作用。为什么呢?

location /profil/(cancel_email|activation) {

如果写下以下内容,而不是

location /profil/cancel_email {
location /profil/activation {

它有效,但我想使用reglar表达式

请问好吗?

1 个答案:

答案 0 :(得分:1)

将正则表达式匹配符号〜添加到您的位置指令中,如下所示:

MN   | CNT
====================
1    |  1
10   |  2
11   |  5
12   |  5

SELECT EXTRACT(MONTH FROM TRUNC(HDATE)) as MN, COUNT(DISTINCT ID) as CNT
    FROM Schema.TRAVEL
        WHERE (ARR = '2' OR ARR = '3')
        AND
        HDATE BETWEEN to_date('2015-10-01', 'yyyy-mm-dd') AND to_date('2016-09-30', 'yyyy-mm-dd')
GROUP BY EXTRACT(MONTH FROM TRUNC(HDATE));

参考:http://nginx.org/en/docs/http/ngx_http_core_module.html#location