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

GAE子域名映射后访问404错误的排查与解决

GAE自定义子域名映射后404错误的排查与解决

问题场景

  • 服务标识为l2-main的ServiceA在GAE默认域名https://l2-main-dot-winky-products.uc.r.appspot.com/运行正常
  • 通过dispatch.yaml配置子域名映射:
    - url: "l2.web3m.io/*"
      service: l2-main
    
  • 访问子域名l2.web3m.io时出现404错误:
    1. That’s an error. The requested URL / was not found on this server. That’s all we know.
  • 云平台显示域名连接状态正常

相关配置(app.yaml)

env: standard
runtime: nodejs16
service: l2-main
handlers:
  - url: /static
    static_dir: build/static
  - url: /beta
    static_files: build/beta/index.html
    upload: build/beta/index.html
  - url: /(.*\.(json|ico|js))$
    static_files: build/\1
    upload: build/.*\.(json|ico|js)$
  - url: .*
    static_files: build/index.html
    upload: build/index.html
  - url: /favicon\.ico
    static_files: build/favicon.ico
    upload: build/favicon.ico
env_variables:
  APP_ENV: "production"
  NODE_ENV: "production"

排查结果与解决方法

排查后确认问题根源在于app.yaml的handlers配置中,/beta路径对应的静态文件路径build/beta/index.html存在错误。修正该路径后,子域名l2.web3m.io的访问恢复正常。

内容的提问来源于stack exchange,提问作者Shani Elkalay

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.16 23:13:31