location ~ ^/pages/\d+_index.json{
proxy_pass /pages/index.json;
}
试了一下不行
我对nginx配置不太熟悉,请教了.
location ~ ^/pages/\d+_index.json{
proxy_pass /pages/index.json;
}
试了一下不行
我对nginx配置不太熟悉,请教了.
我找到了两种解决的方法
rewrite:
location ~ ^/pages/{
rewrite ^/pages/(\d+)/\d+_index.json http://$host/pages/$1/index.json break;
}
proxy_pass
location ~ ^/pages/(\d+)/\d+_index.json$ {
proxy_pass http://$host/pages/$1/index.json;
}
2 回答1.1k 阅读
1 回答884 阅读✓ 已解决
1 回答748 阅读
1 回答946 阅读
742 阅读
你可以使用 rewrite 重写你的请求路径