从 url 中删除端口号
我在一台机器上有两个 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
现在我的问题是我想从网址中删除端口号 444。有什么办法可以删除或隐藏它。我无法为两个实例使用相同的端口号 443。
谢谢
I have two instances of tomcat on a single machine both instances accepting secure request. Suppose:
one has connector port configured as 8080 and redirect port as 443. The other one has connector port configured as 8083 and redirect port 444. So if first tomcat receive request as
http://localhost:8080/abc/index.html
it then redirect to https://localhost/abc/index.html
and if 2nd tomcat receive request as
http://localhost:8083/abc/index.html
it then redirects to https://localhost:444/abc/index.html
now my problem is that i want to remove that port number 444 from the url. Is there any way to remove that or hide that. I can't use same port number 443 for both the instance.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,你不能那样做。如果您未指定端口,Web 浏览器将仅在端口 443 上连接 HTTPS。
No you can't do that. The web browser will only connect on port 443 for HTTPS if you don't specify a port.
将额外的静态 IP 地址绑定到您的计算机,并指定第二个 Tomcat 在该地址上使用 443。添加到您的
hosts
文件以使用非数字名称。Bind an additional static IP address to your computer and assign the second Tomcat to use 443 on that address. Add to your
hosts
file to use a non-numeric name.