按照Configuring Enhanced Health Rules Using a Config Document上的说明,使用".ebextensions/YAML/JSON“方法忽略应用程序HTTP4xx错误,具体而言,已将以下内容添加到”.ebtensions/00_option_Settings.config“中:
- namespace: aws:elasticbeanstalk:healthreporting:system
option_name: ConfigDocument
value: {
"Rules": {
"Environment": {
"Application": {
"ApplicationRequests4xx": {
"Enabled": false
}
}
}
},
"Version": 1
}使用此配置,部署到弹性豆茎成功,似乎有预期的效果,但随后访问环境的配置页面(即EB控制台中的https://console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/environment/dashboard?applicationName=my-app&environmentId=e-12345678)时,出现错误:

我尝试引用/转义嵌入到YAML中的JSON等,但没有效果。
在命令行中,eb config工作正常:
aws:elasticbeanstalk:healthreporting:system:
ConfigDocument: '{"Version":1,"Rules":{"Environment":{"Application":{"ApplicationRequests4xx":{"Enabled":false}}}}}'
HealthCheckSuccessThreshold: Ok
SystemType: enhanced发布于 2019-04-09 04:49:41
我的看起来像这样,它工作正常。
option_settings:
- namespace: aws:elasticbeanstalk:healthreporting:system
option_name: ConfigDocument
value: {"Rules": {"Environment": {"Application": {"ApplicationRequests4xx": {"Enabled": false}}}},"Version": 1}https://stackoverflow.com/questions/51664509
复制相似问题