当前的API端点类似
domain.com/api/rest/[actual_module_routing_path, eg. cms/page/home]
在新系统中,它必须类似于
domain.com/rest/V1/$1
无论HTTP方法(GET,POST,PUT,DELETE)如何,它都必须工作。尝试这样的事情,我无法使其正常工作,将不胜感激一些帮助
location /api/rest {
#Rewrite $uri=/api/rest/ back to just $uri=/rest/V1/$1
rewrite ^/api/rest/(.*)$ /rest/V1/$1 break;
}
location ~ /api/rest/(.*)
{
rewrite ^(.*)$ /rest/v1/$1 redirect;
}