Home Operation and Maintenance Nginx The difference between tomcat and nginx

The difference between tomcat and nginx

Jun 22, 2019 am 10:18 AM
nginx tomcat

The difference between tomcat and nginx

The servers on the web are all called web servers, but everyone has different divisions of labor.


nginx is commonly used as static content service and proxy server (not your FQ proxy), directly forwarding external requests to subsequent application services (tomcat, django or something), tomcat is more used as an application container, allowing java web app to run in it, corresponding to the same level as jboss, jetty and other things.

But nothing is absolute. nginx can also provide application functions through module development, and tomcat can also directly provide http services. It is usually used in intranets and scenarios that do not require small services such as flow control.

Apache is used less and less, and its functions generally overlap more with nginx.

Strictly speaking, Apache/Nginx should be called "HTTP Server"; while Tomcat is an "Application Server", or more accurately, a "Servlet/JSP" "Application container (applications developed in other languages ​​such as Ruby/Python cannot run directly on Tomcat).


An HTTP Server is concerned with transmission and access control at the HTTP protocol level, so on Apache/Nginx you can see functions such as proxy and load balancing. The client accesses resources stored on the server (HTML files, image files, etc.) through HTTP Server. Through CGI technology, the processed content can also be distributed through HTTP Server, but an HTTP Server always only faithfully transmits the files on the server to the client through HTTP protocol.

The application server is a container for application execution. It first needs to support the runtime of the development language (for Tomcat, it is Java) to ensure that the application can run normally on the application server. Secondly, it needs to support application-related specifications, such as class libraries and security features. For Tomcat, it is necessary to provide standard class libraries, Interfaces, etc. required for JSP/Sevlet operation. For convenience, application servers often integrate HTTP Server functions, but they are not as powerful as professional HTTP Servers. Therefore, application servers often run behind HTTP Servers, execute applications, and convert dynamic content into static content through HTTP Server distributes to clients.

For more Nginx related technical articles, please visit the Nginx Tutorial column to learn!

The above is the detailed content of The difference between tomcat and nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to deploy jar project in tomcat How to deploy jar project in tomcat Apr 21, 2024 am 07:27 AM

How to deploy jar project in tomcat

How to allow external network access to tomcat server How to allow external network access to tomcat server Apr 21, 2024 am 07:22 AM

How to allow external network access to tomcat server

How to deploy multiple projects in tomcat How to deploy multiple projects in tomcat Apr 21, 2024 am 09:33 AM

How to deploy multiple projects in tomcat

Where is the tomcat installation directory? Where is the tomcat installation directory? Apr 21, 2024 am 07:48 AM

Where is the tomcat installation directory?

Where is the root directory of the tomcat website? Where is the root directory of the tomcat website? Apr 21, 2024 am 09:27 AM

Where is the root directory of the tomcat website?

How to check the port number of tomcat How to check the port number of tomcat Apr 21, 2024 am 08:00 AM

How to check the port number of tomcat

How to check the number of concurrent connections in tomcat How to check the number of concurrent connections in tomcat Apr 21, 2024 am 08:12 AM

How to check the number of concurrent connections in tomcat

How to run two projects with different port numbers in tomcat How to run two projects with different port numbers in tomcat Apr 21, 2024 am 09:00 AM

How to run two projects with different port numbers in tomcat

See all articles