温馨提示:本文翻译自stackoverflow.com,查看原文请点击:java - Java11 appengine standard incorrect app.yaml handler
google-app-engine java java-11

java - Java11 AppEngine标准不正确的app.yaml处理程序

发布于 2020-03-31 23:28:14

我有运行在App Engine标准上的Spring Boot应用程序,我想对所有URL强制执行https。

这是我的app.yaml文件:

runtime: java11

instance_class: F2

automatic_scaling:
  max_instances: 1

env_variables:
  SPRING_PROFILES_ACTIVE: "prod"

handlers:
- url: /.*
  secure: always

但是在部署期间,我收到此错误:

2020-01-30T18:40:26.0058599Z [INFO] Detected App Engine app.yaml based application.
2020-01-30T18:40:26.9028317Z Jan 30, 2020 6:40:26 PM com.google.cloud.tools.appengine.operations.GcloudRunner run
2020-01-30T18:40:26.9032622Z INFO: submitting command: /home/runner/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/bin/gcloud app deploy --project ***
2020-01-30T18:40:29.4297525Z [INFO] GCLOUD: ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/home/runner/work/czech-***/czech-***/target/appengine-staging/app.yaml]
2020-01-30T18:40:29.4298835Z [INFO] GCLOUD: Unknown url handler type.
2020-01-30T18:40:29.4299464Z [INFO] GCLOUD: <URLMap 
2020-01-30T18:40:29.4300033Z [INFO] GCLOUD:     secure=always 
2020-01-30T18:40:29.4300627Z [INFO] GCLOUD:     static_files=None 
2020-01-30T18:40:29.4301260Z [INFO] GCLOUD:     application_readable=None 
2020-01-30T18:40:29.4301875Z [INFO] GCLOUD:     auth_fail_action=redirect 
2020-01-30T18:40:29.4302497Z [INFO] GCLOUD:     require_matching_file=None 
2020-01-30T18:40:29.4303102Z [INFO] GCLOUD:     static_dir=None 
2020-01-30T18:40:29.4303758Z [INFO] GCLOUD:     redirect_http_response_code=None 
2020-01-30T18:40:29.4304411Z [INFO] GCLOUD:     http_headers=None 
2020-01-30T18:40:29.4305023Z [INFO] GCLOUD:     url=/.* 
2020-01-30T18:40:29.4305588Z [INFO] GCLOUD:     script=None 
2020-01-30T18:40:29.4306345Z [INFO] GCLOUD:     upload=None 
2020-01-30T18:40:29.4306954Z [INFO] GCLOUD:     api_endpoint=None 
2020-01-30T18:40:29.4307550Z [INFO] GCLOUD:     expiration=None 
2020-01-30T18:40:29.4308157Z [INFO] GCLOUD:     position=None 
2020-01-30T18:40:29.4308745Z [INFO] GCLOUD:     login=optional 
2020-01-30T18:40:29.4313014Z [INFO] GCLOUD:     mime_type=None
2020-01-30T18:40:29.4317758Z [INFO] GCLOUD:     >
2020-01-30T18:40:29.4329558Z [INFO] GCLOUD:   in "/home/runner/work/czech-***/czech-***/target/appengine-staging/app.yaml", line 13, column 17
2020-01-30T18:40:29.4894919Z [INFO] ------------------------------------------------------------------------
2020-01-30T18:40:29.4896185Z [INFO] BUILD FAILURE
2020-01-30T18:40:29.4897311Z [INFO] ------------------------------------------------------------------------
2020-01-30T18:40:29.4898621Z [INFO] Total time:  24.680 s
2020-01-30T18:40:29.4899728Z [INFO] Finished at: 2020-01-30T18:40:29Z

它说未知的URL处理程序类型。但对我来说似乎还可以

查看更多

提问者
estn
被浏览
26
estn 2020-01-31 19:39

最后,我使用了此处理程序,它现在可以工作:

handlers:
- url: .*
  secure: always
  script: auto

最新帖子

最新文章