需要在ELB/ECS的配置中添加一个Http头配置,确保每个应用程序的特定响应头信息能够正常返回。以下是示例代码:
http:
response:
headers:
strict-transport-security: "max-age=31536000; includeSubdomains"
x-content-type-options: "nosniff"
x-frame-options: "SAMEORIGIN"
x-xss-protection: "1; mode=block"
在上面的示例中,列出了一些常见的Http头配置,可以根据具体的应用程序需要进行调整。添加完毕后,重新启动ELB/ECS实例即可。