繁体   English   中英

在wildfly9中访问http时,会下载空白下载文件

[英]While accessing http in wildfly9, a blank download file is getting downloaded

我通过更改以下配置阻止了wildfly 9.0中的http协议(仅启用了https)

将connector-ref =“default”更改为connector-ref =“default-ssl”

<subsystem xmlns="urn:jboss:domain:remoting:3.0">
  <endpoint worker="default"/>
  <http-connector name="http-remoting-connector" connector-ref="default-ssl" security-realm="ApplicationRealm"/>
</subsystem>

评论了http听众

<subsystem xmlns="urn:jboss:domain:undertow:2.0">
            <buffer-cache name="default"/>
            <server name="default-server">
               <!-- <http-listener name="default" socket-binding="http" redirect-socket="https"/> -->
                <https-listener name="def.....

它工作..我能够阻止http和启用https协议访问。 理想情况下,它应该拒绝http请求。 但是,现在问题是,每当我访问http:// localhost:8080 / MyWebApp /时 ,它拒绝http请求,但同时,网页正在下载空白下载文件。 为什么???

谢谢。

您应该将您的http请求重定向到https而不是禁用http:

 <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="443" />

在处理程序部分添加一个重定向处理程序,其中包括:

<host name="other-host" alias="www.mysite.com, ${prop.value:default-alias}" default-web-module="something.war" disable-console-redirect="true">
        <location name="/" handler="welcome-content">
            <filter-ref name="redirects" predicate="!secure" />
        </location>
        <filter-ref name="headers"/>
    </host>
</server>

... https:// myserver /'“redirect =”true“/>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM