Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i deploy my .war on an nginx server

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

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

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

like image 934
user3046636 Avatar asked Apr 04 '15 22:04

user3046636


People also ask

Can we deploy jar in NGINX?

Nginx is a HTTP server. It can't run Jar files (or any Java code).

Can we run Java on NGINX?

it is not possible. However, you can configure nginx to act as a reverse proxy in front of a Tomcat server. Save this answer.

Can NGINX be used as a web server?

It started out as a web server designed for maximum performance and stability. In addition to its HTTP server capabilities, NGINX can also function as a proxy server for email (IMAP, POP3, and SMTP) and a reverse proxy and load balancer for HTTP, TCP, and UDP servers.

Can NGINX replace Tomcat?

Web Performance: Is good at dealing with Java servlets, the performance with static content is lower than that of Nginx. Here Nginx is much better than Apache Tomcat. It can handle multiple requests for static and dynamic content simultaneously using as little memory as possible.


2 Answers

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.

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

like image 104
Paul H Avatar answered Oct 18 '22 05:10

Paul H


Please try either of

  1. Use Nginx as a reversed proxy in the front of Tomcat OR
  2. Use nginx-tomcat8 to embedding Tomcat into Nginx to run war
like image 42
xfeep Avatar answered Oct 18 '22 05:10

xfeep