在这里,如何将替换设置为任意地址,以便我可以在AWS应用程序负载均衡器中使用它。
<subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" enable-lookups="false" secure="true" />
<virtual-server name="default-host" enable-welcome-root="true">
<rewrite pattern="^/(.*)$" substitution="https://localhost:443/$1" flags="RL">
<condition test="%{HTTPS}" pattern="off" />
</rewrite>
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
我想.
<rewrite pattern="^/(.*)$" substitution="https://%HOST_NAME%" flags="RL">
<condition test="%{HTTPS}" pattern="off" />
</rewrite>发布于 2017-05-13 01:29:05
下面是从http重定向到EAP 6中的https的步骤,
将redirect-port="443"添加到http连接器,如下所示:
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="443"/>将https的套接字绑定更改为443,如下所示:
<socket-binding name="https" port="443"/>在EAP 6中配置https连接器,
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
<ssl name="ssl" key-alias="mykey" password="password" certificate-key-file="/path/to/keystore.jks"/>
</connector>编辑应用程序的web.xml如下:
<web-app>
<security-constraint>
<web-resource-collection>
<web-resource-name>Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
</web-app>发布于 2020-09-30 09:09:13
这就是对我起作用的东西(在信任/独立-Ful.xml中的更改):
<filters>
<rewrite name="http-to-https" target="https://${jboss.qualified.host.name}:8443%U" redirect="true"/>
</filters>https://stackoverflow.com/questions/43933730
复制相似问题