Java 我可以在 nginx 服务器上部署我的 .war 吗

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29452141/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 08:01:39  来源:igfitidea点击:

Can i deploy my .war on an nginx server

javatomcatnginxserver

提问by user3046636

I really love nginx for the stability and way requests are handled.

我真的很喜欢 nginx 的稳定性和处理请求的方式。

And i really love tomcat for the java and the user friendliness

我真的很喜欢 tomcat 的 Java 和用户友好性

Is there a way to deploy my .war on a nginx server ?

有没有办法在 nginx 服务器上部署我的 .war ?

采纳答案by Paul H

I don't believe this is possible as nginx is not a servlet container, so it has no understanding of what a .war file is. You can configure nginx to act as a reverse proxy in front of a Tomcat server so this might get you the best of both worlds.

我不相信这是可能的,因为 nginx 不是 servlet 容器,所以它不了解 .war 文件是什么。您可以将 nginx 配置为充当 Tomcat 服务器前的反向代理,这样您就可以两全其美。

A quick Google search came up with this http://wiki.nginx.org/JavaServerswhich might give you what you're looking for.

这个http://wiki.nginx.org/JavaServers 的快速谷歌搜索可能会给你你正在寻找的东西。

回答by xfeep

Please try either of

请尝试其中之一

  1. Use Nginx as a reversed proxy in the front of Tomcat OR
  2. Use nginx-tomcat8to embedding Tomcat into Nginx to run war
  1. 使用Nginx作为Tomcat前端的反向代理OR
  2. 使用nginx-tomcat8将Tomcat嵌入到Nginx中运行war