1
我需要nginx的重写规则(转换片段以得到paramters)
/secure/token/timestamp/path/to/the/resource/
在这个格式被改写:
/s/path/to/the/resource/?st=token&e=timestamp
什么,我试图做的是:
location /secure/(?<token>)/(?<timestamp>)/(?<path>) {
rewrite^/s/$path/?st=$token&e=$timestamp
}
但它显然不工作。这个语法似乎并不正确。我如何在nginx规则中使用url来玩这个游戏?
编辑: 现在尝试是这样的:相同的结果:
location /secure/(.*)/(.*)/(.*) {
rewrite^/s/$3?st=$1token&e=$2timestamp;
}