我的应用程序包含了Yii2和Php框架。
我把我的应用程序托管在google云平台的应用引擎上。
这是我的代码和app.yaml文件代码的截图。
threadsafe: true
runtime: php55
api_version: 2
handlers:
# The root URL (/) is handled by the Go application.
# No other URLs match this pattern.
- url: /(.+)
static_files: \1
upload: (.*)
- url: /web-service/*
script: web-service/yii
- url: /
static_files: index.html
upload: index.html
我的Yii2库可以在web服务目录中使用,当我从邮递员调用rest时,它返回404页未找到错误。
我在app.yaml文件中遗漏了什么。
帮我解决这个问题。
我的Api就是这样叫的。
https://abcxyz.appspot.com/web-service/web/user-registration/login-user
发布于 2018-02-28 14:48:14
URL处理程序的顺序不正确。
盖伊把这些从上到下。你的第一个处理程序将匹配所有的东西。它永远不会到达其他两个人。
您需要更改app.yaml中的顺序:
threadsafe: true
runtime: php55
api_version: 2
handlers:
# The root URL (/) is handled by the Go application.
# No other URLs match this pattern.
- url: /
static_files: index.html
upload: index.html
- url: /web-service/*
script: web-service/yii
- url: /(.+)
static_files: \1
upload: (.*)建议总是最宽的底部,最严格的顶部。
https://serverfault.com/questions/897985
复制相似问题