CGI是早期没有php等网页生成语言的时候,
用来搭建动态网站的一种技术,就是我上课展示的那样,
每一个小程序负责一个页面的生成,
一次用户请求就是运行一次这个小程序。
这个程序可以用Python写,也可以用C写,
这种技术的统称叫CGI。
NGINX doesn’t “know” how to run Python, so it needs a gateway to an environment that does. FastCGI is a widely used interface for PHP, Python, and other languages.
However, a more popular choice for communication between Python and NGINX is the Web Server Gateway Interface (WSGI). WSGI works in multithreaded and multiprocess environments, so it scales well across all the deployment options mentioned in this blog post.
implement static file caching
Faster delivery to the use
NGINX is optimized for static file caching and executes requests for static content much faster than an application server.
Reduced load on the application server – The application server doesn’t even see requests for cached static files, because the web server satisfies them.