vue.config.js proxy
时间: 2023-08-24 22:15:16 浏览: 91
在vue.config.js中,proxy用于配置代理。通过配置proxy,可以将请求转发到指定的目标地址。在引用\[1\]中的示例中,proxy配置了两个代理。第一个代理将以/api/开头的请求转发到http://localhost:8060,第二个代理将以/apis开头的请求转发到https://example.com。在引用\[2\]中的示例中,proxy配置了两个代理。第一个代理将以/v1开头的请求转发到https://monitor-api.xxx,第二个代理将以/(d|api|login|public)/开头的请求转发到https://monitor-third-pard-api.xxx。在引用\[3\]中的示例中,proxy配置了一个代理,将以/chc-shop开头的请求转发到https://www.zhbbroker.cn。这样配置代理可以实现在开发环境中解决跨域问题,将请求转发到指定的目标地址。
#### 引用[.reference_title]
- *1* [vue.config.js中配置proxy代理https](https://blog.csdn.net/hbiao68/article/details/121718528)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [[vue]vue.config.js之proxy代理配置](https://blog.csdn.net/tjj3027/article/details/124042186)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [vue.config.js配置proxy代理解决跨越;proxy代理报404;](https://blog.csdn.net/i_am_a_div/article/details/127517818)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文