将/ image请求重写到另一个域

我有一个本地的grunt服务器,正在运行一个有角度的应用程序。

图像请求的格式如下:

http://localhost:9000/image/a1b2c3d4e5f6-300

其中a1b2c3d4e5f6是图片ID,300是请求的宽度

使用connect-modrewrite插件进行咕unt声,我想将其中带有/image/的任何请求路由到另一个域,这样:

http://localhost:9000/image/a1b2c3d4e5f6-300

转到:

https://other-domain.com/a1b2c3d4e5f6?width=300

保留ID,并将width参数转换为使用url参数格式。

我首先尝试使重定向工作,而不必担心width参数。

middlewares.push(modRewrite(['^/image/(.*)$ https://other-domain.com/$1 [P]']));

这似乎不起作用,我也不知道为什么。

zhuzhihaolf1 回答:将/ image请求重写到另一个域

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3121305.html

大家都在问