【问题标题】:remove port number from the url从 url 中删除端口号
【发布时间】:2011-07-04 00:32:20
【问题描述】:

我在一台机器上有两个 tomcat 实例,两个实例都接受安全请求。认为: 一个连接器端口配置为 8080,重定向端口为 443。另一个连接器端口配置为 8083,重定向端口为 444。因此,如果第一个 tomcat 接收请求为

http://localhost:8080/abc/index.html

然后重定向到https://localhost/abc/index.html

如果第二个 tomcat 接收请求为

http://localhost:8083/abc/index.html

然后它重定向到https://localhost:444/abc/index.html

现在我的问题是我想从 url 中删除端口号 444。有什么办法可以删除或隐藏它。我不能为这两个实例使用相同的端口号 443。

谢谢

【问题讨论】:

    标签: url tomcat port


    【解决方案1】:

    不,你不能那样做。如果您不指定端口,Web 浏览器将仅连接 HTTPS 的 443 端口。

    【讨论】:

      【解决方案2】:

      为您的计算机绑定一个额外的静态 IP 地址并分配第二个 Tomcat 以在 那个地址上使用 443。添加到您的 hosts 文件以使用非数字名称。

      192.168.1.99  localhost2
      

      【讨论】:

      • 你能解释一下怎么做吗?
      • 谷歌搜索 windows add static ip addresswindows add host entry 应该可以让您轻松完成它。
      猜你喜欢
      • 2014-07-18
      • 2015-08-17
      • 2017-01-01
      • 2016-02-06
      • 1970-01-01
      • 2014-12-18
      • 2018-08-16
      相关资源
      最近更新 更多