File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ # nginx+flask部署
2+ ## 一、正向代理与反向代理
3+ 正向代理中客户端非常明确自己要访问的服务器地址,服务器只知道代理来自哪个代理,不知道具体来自哪个客户端。<br >
4+ 反向代理,客户端无法感知代理的存在,访问者并不知道自己访问的是代理服务器。
5+ ![ ] ( https://github.com/daacheng/PythonBasic/blob/master/pic/nginxproxy1.png )
6+ ## 二、centos下安装nginx
7+ 参考教程 http://www.cnblogs.com/taiyonghai/p/6728707.html
8+ ### 2.1. 准备好相关组件
9+
10+ cd /usr/local/src
11+ wget http://nginx.org/download/nginx-1.10.2.tar.gz
12+ wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz
13+ wget http://zlib.net/zlib-1.2.11.tar.gz
14+ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
15+ ### 2.2. 安装c++编译环境
16+
17+ yum install gcc-c++
18+ ### 2.3. 安装Nginx及相关组件
19+ #### openssl安装
20+
21+ tar zxvf openssl-fips-2.0.10.tar.gz
22+ cd openssl-fips-2.0.10
23+ ./config && make && make install
24+ #### pcre安装
25+
26+ tar zxvf pcre-8.40.tar.gz
27+ cd pcre-8.40
28+ ./configure && make && make install
29+ #### zlib安装
30+
31+ tar zxvf zlib-1.2.11.tar.gz
32+ cd zlib-1.2.11
33+ ./configure && make && make install
34+ #### nginx安装
35+
36+ tar zxvf nginx-1.10.2.tar.gz
37+ cd nginx-1.10.2
38+ ./configure && make && make install
39+ ### 2.4. 启动nginx
40+ * 查看whereis nginx
41+ * cd /usr/local/nginx/sbin
42+ * ./nginx
43+ ![ ] ( https://github.com/daacheng/PythonBasic/blob/master/pic/nginxproxy2.png )
44+ ## 三、nginx基本操作
45+ * 启动: /usr/local/nginx/sbin/nginx
46+ * 停止/重启: /usr/local/nginx/sbin/nginx -s stop(quit、reload)
47+ * 帮助: /usr/local/nginx/sbin/nginx -h
48+ * 配置文件: vim /usr/local/nginx/conf/nginx.conf
You can’t perform that action at this time.
0 commit comments