问题原文
原帖链接 · simonalexander2005 · CC BY-SA 4.0
I have the following setup:
HTTPS request -> AWS ALB -> Mapped to HTTP (one of two possible ports) -> Websphere 9.0.5
This works fine, except:
When I go to my url without a trailing slash (e.g. https://url.com/test instead of https://url.com/test/), WebSphere serves a 302 redirect to http://url.com:9082/test/, for example, instead of honouring the original https request and port. This then doesn't load because the internal http port is not accessible externally.
The original url and protocol is captured in X-Forwarded-Proto and X-Forwarded-Host headers.
Is there any way to tell WebSphere to do the redirect in the way I'd expect, so the user's browser sees https://url.com/test/? Or, alternatively, for the application to just work without the trailing slash?
已采纳解答
原帖链接 · simonalexander2005 · CC BY-SA 4.0
The following custom properties need to be configured in WebSphere, under Application Servers -> ServerName -> Web Container -> Custom Properties:
- com.ibm.ws.webcontainer.extractHostHeaderPort=true
- httpsIndicatorHeader=X-Forwarded-Proto
- trusthostheaderport=true
See https://www.ibm.com/docs/en/was/9.0.5?topic=configuration-web-container-custom-properties for documentation
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
