我想为GAE (php运行时)创建非常标准的设置:带有特定URL的2个模块(路由):
我创建了4个.yaml配置文件:
app.yaml
application: ABC
version: 1
runtime: php55
api_version: 1
threadsafe: yes
automatic_scaling:
max_idle_instances: 20
handlers:
- url: /.*
script: api/web/index.phpdispatch.yaml
application: ABC
dispatch:
- url: "*/app/*"
module: web-based
- url: "*/*"
module: defaultweb_based.yaml
application: ABC
module: web-based
version: 1
runtime: php55
api_version: 1
threadsafe: yes
automatic_scaling:
min_idle_instances: 2
max_pending_latency: 1s
handlers:
- url: /(.*\.(gif|png|jpg|css|js|otf))
static_files: /\1
upload: /(.*\.(gif|png|jpg|js|css|otf))api.yaml
application: ABC
module: default
version: 1
runtime: php55
api_version: 1
threadsafe: yes
manual_scaling:
instances: 1
handlers:
- url: /(.*\.(gif|png|jpg|css|js|otf))
static_files: web/\1
upload: web/(.*\.(gif|png|jpg|js|css|otf))
- url: /assets/(.+)
static_files: web/assets/\1
upload: web/assets/(.+)
- url: /.*
script: web/index.php 目录结构:
- api/api.yaml
- app/web_base.yaml
- app.yaml
- dispatch当我尝试update_dispatch时,找不到调度配置文件。有人能帮我吗?
发布于 2017-02-10 15:14:54
在多模块应用程序中,不再存在应用程序级别的app.yaml,每个模块只有一个.yaml文件,仅此而已。
因此,去掉顶级app.yaml (如果需要的话,将其相关内容合并到api.yaml文件中,这是default模块的文件)。这两个文件发生冲突,可能会混淆update_dispatch操作。然后部署默认模块--通常需要在应用程序级信任(如dispatch.yaml文件)之前部署,其他模块也可以部署。
也许可以看一下Can a default service/module in a Google App Engine app be a sibling of a non-default one in terms of folder structure?,它适用于python应用程序,但其中的许多东西,如app dir结构、应用级信任(例如分派)和部署,也适用于php。
边注:
web_based.yaml中缺少一个动态处理程序。default模块的调度规则--在那里,没有路由的请求会被分派到任何地方https://stackoverflow.com/questions/42161817
复制相似问题