从tomcat中找出自己的公共地址
我有 tomcat 应用程序(war 文件),人们可以根据需要部署它。例如,通过在 Coyote 中使用 http/https 连接器,或使用 mod_jk/mod_proxy 让 Apache 处理传入的 http/https。
我遇到的一个问题是我需要从应用程序内找出部署服务器的公共地址。有什么方法可以从传入的请求中提取此内容吗?例如,当应用程序通过 mod_jk 与 ajp13 后端部署时,我仍然想知道请求最初是对 https 完成的: //myserver.com。
I have tomcat application (war file) which people can deploy as they wish. For example by using http/https connectors in Coyote, or using mod_jk/mod_proxy to let Apache handle incoming http/https.
A problem that I am having is that I need to figure out the public address that the server is deployed at from within the application. Is there any way to extract this from the incoming request? For example when the application is deployed through mod_jk with the ajp13 back-end, I would still like to know that the request was originally done to https://myserver.com.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用jsonip,这样就可以在启动时执行,而不需要等待请求。
Use jsonip, this way you can do it on startup and don't need to wait for a request.