
是否有使用 WebLogic 的 Strict-Transport-Security 標頭的實作?我認為它會使用 web.xml 中的某些內容<security-constraint>
我知道如何為基於 Apache 的伺服器執行此操作,但我不確定是否要將其新增至 WebLogic 中。
請注意,對於此實例,我無法在 WebLogic 之前使用 Apache。
答案1
weblogic 上沒有針對 HSTS(HTTP Strict Transport Security)的任何特定配置。
但是,可以將安裝配置為在 HTTPS 協定上執行。
您可以在 web.xml 中將“transport-guarantee”設定為 CONFIDENTIAL 或 INTEGRAL。透過該設置,如果原始請求是透過 HTTP 進行的,WebLogic Server 將自動將用戶端重定向到 HTTPS 連接埠。
web.xml 檔案條目的範例如下:
<security-constraint> <user-data-constraint> <description>USE SSL</description> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
答案2
我可能會將 Nginx 作為反向代理放在 Weblogic 前面,並使用它來完成整個 HTTPS 操作,包括 HSTS。
然後你要做的就是將以下配置加入到Nginx配置中
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;