Skip to content

使用Nginx作为python web的反向代理 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rickyyangrui opened this issue Nov 22, 2017 · 0 comments
Open

使用Nginx作为python web的反向代理 #4

rickyyangrui opened this issue Nov 22, 2017 · 0 comments

Comments

@rickyyangrui
Copy link
Owner

什么是反向代理?

在电脑网络中,反向代理是代理服务器的一种。它根据客户端的请求,从后端的服务器(如Web服务器)上获取资源,然后再将这些资源返回给客户端。与前向代理不同,前向代理作为一个媒介将互联网上获取的资源返回给相关联的客户端,而反向代理是在服务器端(如Web服务器)作为代理使用,而不是客户端。
1

反向代理的功能?

  • 加密和SSL加速
  • 负载均衡
  • 缓存静态内容
  • 压缩
  • 减速上传
  • 安全
  • 外网发布

Linux部署环境

  • 操作系统:Centos7
  • 数据库: Mysql
  • 编程语言:Python3.6
  • 队列缓存:Redis
  • web反向代理:Nginx
  • 依赖的环境:Flask、Pymysql、Wtform、Sqlalchemy、Redis

部署步骤

  • 安装Python3.6(Centos7自带Python2)
  • 配置修改yum源(依赖Python2,将默认的Python3替换成为Python2)
  • 编译安装Mysql
  • 编译安装Nginx
  • 编译安装Redis
  • 安装项目依赖的库
  • 将本地的代码上传至服务器
  • 将初始化数据导入mysql数据库,配置Nginx反向代理
  • 运行项目代码,并测试

动手搭建环境

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant