Home>Article>Operation and Maintenance> What are the differences between nginx and tomcat?

What are the differences between nginx and tomcat?

藏色散人
藏色散人 Original
2019-06-10 15:04:04 3553browse

What are the differences between nginx and tomcat?

What are the differences between nginx and tomcat?

The difference between nginx and tomcat

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

nginx is often used as a static content service and proxy server (not your FQ proxy). It directly forwards external requests to subsequent application services (tomcat, django, etc.). 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 knowledge, please visit theNginx usage tutorialcolumn!

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

Statement:
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
Previous article:What does nginx error mean? Next article:What does nginx error mean?