What is the difference between application server and web server?

前端 未结 27 2176
攒了一身酷
攒了一身酷 2020-11-22 17:03

What is the difference between application server and web server?

27条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 17:07

    • web server: for every URL, it returns a file. That's all it does. The file is static content, meaning, it is stored somewhere in the server, before you make your request. Most popular web servers are apache http and nginx.
    • application server: for every URL, it runs some code, written in some language, generates a response, and returns it. The response doesn't exist in advance, it is generated for your particular request, that is, it is dynamic content. Application servers are different for each language. Some popular examples are tomcat/jetty for java, uwsgi/gunicorn for python.

    Almost every page you visit uses both. The static content (eg, images, videos) is served by the web server, and the rest (the parts that are different between you and other users) are generated by the application server.

提交回复
热议问题