将用户下载请求重定向到完全不同的服务器

问题描述 投票:0回答:1

假设我想在GCP上存储用户文件,但我的网站托管在AWS上。

当用户访问https://www.example.com/some_file时可以启动GCP上存在的下载吗?

如何实现?通过我的NodeJS应用中的Express路线吗?

将保留原始网址吗?

这里最好的选择是什么?

node.js google-cloud-platform get webserver
1个回答
2
投票
HTTP/1.1 302 Found Location: https://gcp.example.com/somewhere-else

如果您使用快递,则存在一种方便的方法:

res.redirect(301, 'https://gcp.example.com/somewhere-else')
© www.soinside.com 2019 - 2024. All rights reserved.