Google app engine 谷歌应用引擎忽略上下文路径
我的app.yaml中有以下上下文路径处理程序:Google app engine 谷歌应用引擎忽略上下文路径,google-app-engine,Google App Engine,我的app.yaml中有以下上下文路径处理程序: runtime: nodejs env: flex resources: cpu: 1 memory_gb: 1 disk_size_gb: 20 handlers: - url: /api secure: always script: app.js - url: / secure: always static_dir: public 静态工作正常。我有两个问题: secure: always pragma没
runtime: nodejs
env: flex
resources:
cpu: 1
memory_gb: 1
disk_size_gb: 20
handlers:
- url: /api
secure: always
script: app.js
- url: /
secure: always
static_dir: public
静态工作正常。我有两个问题:
secure: always
pragma没有按预期工作。没有从http重定向到https
其次,我在NodeJS应用程序中有/test端点。但是/api/test是404,但是/test可以工作,忽略/api
我做错了什么
生成的运行时配置:
runtime: nodejs
api_version: '1.0'
env: flexible
threadsafe: true
handlers:
- url: /api
script: app.js
secure: always
- url: '/(.*)'
secure: always
application_readable: false
static_files: "public/\\1"
require_matching_file: false
upload: 'public/.*'
automatic_scaling:
min_num_instances: 2
max_num_instances: 20
cpu_utilization:
target_utilization: 0.5
resources:
cpu: 1
memory_gb: 1
disk_size_gb: 20
如中所述,flex环境不支持app.yaml中的handlers部分。这篇文章还举了几个例子来说明如何在nodejs中启动和运行它
问题的后半部分有类似的答案-您需要直接在节点应用程序中实现这些重定向。如中所述,flex环境不支持app.yaml中的处理程序部分。这篇文章还举了几个例子来说明如何在nodejs中启动和运行它
你问题的后半部分有一个类似的答案——你需要直接在你的节点应用程序中实现这些重定向