简体   繁体   English

如何为没有端口号的 Spring Boot webapp 选择 URL?

[英]How do I choose the URL for my Spring Boot webapp without port number?

I have production tomcat server running on 8080 port with few war files.我有在 8080 端口上运行的生产 tomcat 服务器,几乎没有战争文件。 Now, I have created a vaadin/spring-boot jar, and I need to deploy it in that server.现在,我已经创建了一个 vaadin/spring-boot jar,我需要将它部署在该服务器中。 I have changed the embedded port of spring-boot application to 8082. Its working fine, but the URL is showing like - localhost:8082/statprojectdemo .我已将 spring-boot 应用程序的嵌入式端口更改为 8082。它工作正常,但 URL 显示为 - localhost:8082/statprojectdemo

And current requirement demands that 8082 should not be seen in the URL.并且当前的要求要求 8082 不应出现在 URL 中。 So, Is there anyway I can use the URL as localhost:/statprojectdemo instead of mentioning port number.所以,无论如何我可以使用 URL 作为localhost:/statprojectdemo而不是提及端口号。

Note* - I can't use port number 8080 or 80 as my production tomcat is running on that.注意* - 我不能使用端口号 8080 或 80,因为我的生产 tomcat 正在运行。

The port number is hard part of the url.端口号是 url 的硬部分。 So there is no way to direct leave it.所以没有办法直接离开它。

Like Jens said, you need to set up a proxy server that listens on yoururl.com:80/statprojectdemo and communicates with that server on 8082.就像 Jens 说的,你需要设置一个代理服务器来监听 yoururl.com:80/statprojectdemo 并在 8082 上与该服务器通信。

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

相关问题 如何为我的 Spring Boot webapp 选择 URL? - How do I choose the URL for my Spring Boot webapp? 如何在没有任何端口的情况下直接使用 url 访问我的 spring 启动 web 应用程序? - How can I directly use url to access my spring boot web application without any port? 如何找到 Spring Boot 应用程序的端口号? - How to find port number of a Spring Boot app? 带有弹簧启动随机端口号的serenity bdd默认URL - serenity bdd default url with spring boot random port number 如何为我的 Spring Boot 应用显示指向 WebApplicationContext url 的链接? - How do I display a link to the WebApplicationContext url for my Spring Boot app? 想在 URL 中访问没有端口的 Spring Boot 服务 - Want to access Spring Boot Service without port in URL Spring Boot - 如何获取请求的基本URL - Spring Boot - how do I get the base url of a request Spring Boot-如何在运行时获取端口而不使用spring注释 - Spring Boot - How to get the port at runtime without using spring annotations 如何在 Spring Boot REST 中处理未知数量的 RequestParams? - How do I handle an unknown number of RequestParams in Spring Boot REST? 如何使用Swagger记录Spring Boot Webapp的RestController? - How can I document a RestController of a Spring Boot webapp with Swagger?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM