【发布时间】:2019-05-29 17:14:48
【问题描述】:
我的问题:
1) 当来自浏览器的原始请求是使用 https 发出时,为什么我在 Location-header 中获得 http 作为方案?
2) 这是一个 Wildfly 负载均衡器问题吗?
我的请求标头是:
method: POST
scheme: https
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
content-length: 39
content-type: application/x-www-form-urlencoded
origin: https://10.43.201.207
referer: https://10.43.201.207/myapp/login.html
我的响应标头是:
content-length: 0
date: Thu, 03 Jan 2019 04:55:42 GMT
location: http://10.43.201.207/myapp/dashboard.html?init=1
server: WildFly/12
set-cookie: APP_AUTH=leTPWYd1222zsrrtRRtgpuEWEWc7pR0CBuNPYPT5QHbGn_Db7ICK; path=/; secure; HttpOnly
set-cookie: JSESSIONID="leTee33333PWYdSDSDweetRRtgpuc7pR0CBuNPYPT5QHbGn_Db7ICK.master-0:master-server"; Version=1; Path=/myapp; Secure; HttpOnly
status: 302
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-powered-by: Undertow/1
x-xss-protection: 1; mode=block
【问题讨论】:
-
这似乎是一个重定向。
-
嗨罗伯特,是的,它只是重定向,但我们并不是说像使用 http 重定向。在我们的 LoginServlet 代码中,我们在 doPost 方法
response.sendRedirect("dashboard.html" );中编写如下 -
在评论您的问题之前,我做了一些研究。这似乎表明可以在实现 TLS 握手之前发生重定向。
-
那么我是否需要将我的 LoginServlet 代码更改为 http 替换为 https ?还是我缺少一些负载均衡器配置?
-
您好,我对此一无所知,为什么响应标头以 http 形式出现,有人可以在这里建议我如何解决这个问题吗?
标签: http ssl redirect https undertow