如何在IIS中部署Spring Boot应用程序

huangapple go评论81阅读模式
英文:

how to deploy Spring boot application in IIS

问题

我有一个 Spring Boot 应用程序,如果我想在本地运行该应用程序,我们可以使用 spring-boot:run 命令运行,或者只需执行主类,我们的项目就可以运行。但是在这里,我想将相同的应用程序部署到 IIS 服务器上。

我有一个 Angular 应用,只需添加路径并运行 ng build --prod 就足以在 IIS 中运行,但是当涉及到 Java 时,我对如何在 IIS 中运行该应用程序感到困惑。

我认为使用 spring-boot:run 是行不通的,因为它使用了内部的 Tomcat 服务器,但是在 IIS 中,我们应该如何部署这个应用程序呢?

英文:

I have a Spring boot application, If I want to run that application locally we can run with spring-boot:run Or by just executing the main class our project is ready to work. But here I want to deploy the same on IIS Server.

I have an angular app, by just adding the path and running ng build --prod is sufficient to run in the IIS but when coming to java I am confused to run the application in IIS.

I dont think so it will work with spring-boot:run as it is using internal tomcat server, But in the IIS how do we need to deploy this application.

答案1

得分: 1

这是一个基于Java的应用程序,因此不建议在IIS中部署。您可以使用Docker容器来运行该应用程序,然后使用反向代理将请求重定向到该API。

参考链接:

https://github.com/jonashackt/ansible-windows-docker-springboot

https://techcommunity.microsoft.com/t5/iis-support-blog/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world/ba-p/846222

英文:

It is a java based application so it is not recommended to deploy in iis.you could use a docker container to run the application and then use a reverse proxy to redirect the request to that API.

Reference link:

https://github.com/jonashackt/ansible-windows-docker-springboot

https://techcommunity.microsoft.com/t5/iis-support-blog/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world/ba-p/846222

huangapple
  • 本文由 发表于 2020年9月21日 18:08:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/63990154.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定