aws elbv2 modify-rule --rule-arn arn:aws:elasticloadbalancing:us-east-1:123456789012:listener-rule/app/my-loadbalancer/50dc6c495c0c9188/1234567890123456 --priority 10
{
"Type": "Redirect",
"Priority": 1,
"RedirectConfig": {
"Protocol": "HTTPS",
"Port": "443",
"Host": "#{host}",
"Path": "/#{path}",
"Query": "#{query}",
"StatusCode": "HTTP_301"
},
"Condition": {
"Field": "http-header",
"HttpHeaderConfig": {
"HttpHeaderName": "X-Forwarded-Proto",
"Values": ["http"]
}
}
}
以上只是示例代码,实际操作请先了解相关文档和自己的需求,再进行设置。