title |
---|
Nginx 反向代理 |
A reverse proxy is a service that takes a client request, sends the request to one or more proxied servers, fetches the response, and delivers the server’s response to the client.
Nginx 负载均衡 提供哪些优点:
- Load Balancing
- Caching
- SSL Termination
- Compression
- 基于HTTP服务的反向代理
- 基于非HTTP服务的反向代理
- 说明:
- nginx收到客户端发来的请求,根据nginx中配置的路由,将其转发给 gunicorn
- nginx to gunicorn : gunicorn ,找你的来了
- gunicorn 服务器根据WSGI协议解析请求,配置好环境变量,调用start_response方法呼叫flask框架
- gunicorn 服务器 to flask :flask,快来接客,客户资料我都给你准备好了
- flask根据env环境变量,请求参数和路径找到对应处理函数,生成html
- flask to gunicorn : hi gunicorn ,html文档弄好了,拿去吧
- gunicorn 拿到html,再组装根据env变量组装成一个http响应,发送给nginx
- gunicorn 服务器 to nginx :nginx,刚才谁找我来着?回他个话 OK ??!!
- nginx再将响应发送给客户端
Nginx Docker Nginx Reverse Proxy web-server/reverse-proxy nginx-reverse-proxy 代理