You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular 17带代理配置部署Firebase生产环境失效排查求助

Angular项目部署Firebase后代理失效,请求/rss返回主页而非RSS Feed

本地开发模式下代理正常工作,但部署到Firebase生产环境后,请求返回的是主页而非RSS feed,似乎路径错误导致返回根页面。

注:这是一个部署到Firebase云平台的项目。

我的proxy.config.json配置如下:

{
    "/rss": {
         "target": "https://baladoquebec.ca/podcast-name",
         "secure": false,
         "changeOrigin": true
    }
}

angular.json中serve配置如下:

"serve": {
    "builder": "@angular-devkit/build-angular:dev-server",
    "options": {
        "proxyConfig": "proxy.conf.json"
    },
    "configurations": {
        "production": {
            "buildTarget": "halo-comm:build:production"
        },
        "development": {
            "buildTarget": "halo-comm:build:development"
        }
    },
    "defaultConfiguration": "development"
},

http.get函数代码如下:

getFeedList(): Observable<any> {
    return this.http.get('/rss', { responseType: 'text' })
        .pipe(
            map(this.extractFeedList),
            catchError(this.handlerError)
        );
}

请问有没有办法调试或添加日志来了解代理的工作机制?

更新

  • 更新1:发现可以在firebase.json中配置headers和redirects,但目前尚未成功,正在尝试该方案。
  • 更新2:访问/rss路径时,会重定向到最初指定的目标URL。

内容的提问来源于stack exchange,提问作者Jonathan Anctil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 06:23:14