【问题标题】:Connection refused when using IP but not when using localhost使用 IP 时连接被拒绝,但使用 localhost 时连接被拒绝
【发布时间】:2019-12-11 08:28:41
【问题描述】:

我已经在我的 apache 9 服务器中部署了我的 Web 应用程序。我已经按照互联网指南配置了服务器,如果我使用此链接,它可以正常工作:

http://localhost:8080/ejercicios-programacion/

将我重定向到

https://localhost:8443/ejercicios-programacion/

但是,如果我尝试做同样的事情,但不使用 localhost 而是使用 IP,例如:

http://xx.xxxx.xxxx.xx:8080/ejercicios-programacion/

它仍然将我重定向到

https://xx.xxxx.xxx.xx:8443/ejercicios-programacion/

但我收到“拒绝连接”错误。

直到今天,这两种方式都可以完美运行,而我唯一改变的就是为我的网页添加了 ssl 安全性,所以很可能与此有关。这是我在 servers.xml 中的连接器:

<Connector URIEncoding="UTF-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>

<Connector port="8443" URIEncoding="UTF-8" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="C:/cert.pfx" keystorePass="defaultpassword" />

有人知道为什么会这样吗?

【问题讨论】:

  • "apache 9" ?这是一个奇怪的版本值...
  • 9.0.22 但我认为在这种情况下并不重要
  • 可能没有,但 Apache 9 不存在。最新版本为2.4.39,见httpd.apache.org
  • 好的,apache tomcat,不是 apache

标签: apache ssl tomcat web connect


【解决方案1】:

我忘记转发端口,这就是我的路由器拒绝连接的原因,但我已经转发了 8080 端口,所以它仍然在重定向

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-08
    • 2012-06-05
    • 2019-12-28
    • 2016-04-06
    • 1970-01-01
    • 2023-03-21
    相关资源
    最近更新 更多