[英]Vue 3 - Vue.config.js: Proxy problem: Replace the host from the income url
I installed and configured the vue project "conduit" from this page . 我从此页面安装并配置了vue项目“conduit”。 My goal is to rewrite specific image request to a specific host.
我的目标是将特定图像请求重写到特定主机。
It ends up with the error: 它最终导致错误:
Proxy error: Could not proxy request /very_special_image_123456.jpg from localhost:8080 to https://destinationurl.com/ (ENOTFOUND).
Within the vue app I created the webpack config file called "vue.config.js" and filled with content: 在vue应用程序中,我创建了名为“vue.config.js”的webpack配置文件并填充了内容:
module.exports = {
devServer: {
proxy: {
"^/very_special_image": {
target: "https://destinationurl.com/",
changeOrigin: true,
ws: true
}
}
}
};
Example: http://localhost:8080/very_special_image_123456.jpg 示例: http:// localhost:8080 / very_special_image_123456.jpg
Should be rewritten to: https://destinationurl.com/very_special_image_123456.jpg 应改写为: https : //destinationurl.com/very_special_image_123456.jpg
I solved it by myself... 我自己解决了......
The problem was that my target network was unknown on my mashine so that the Proxy error
appeard... 问题是我的目标网络在我的mashine上是未知的,因此
Proxy error
出现...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.