项目中需要用到https服务,所以对Nginx进行了https服务的配置支持
下载Nginx压缩文件,进行编译安装(可以设置相关的编译参数,按需设置)@H_301_2@
文章目标:Nginx同时支持:http 与 https协议
下载目录:/usr/local/Nginx-1.9.7.tar.gz
安装目录:/usr/local/Nginx@H_301_2@
1、解压@H_301_2@
tar -zxvf Nginx-1.9.7.tar.gz
2、编译@H_301_2@
/usr/local/Nginx-1.9.7 ./configure --prefix=/usr/local/Nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module make make install
3、 测试安装是否成功@H_301_2@
cd /usr/local/Nginx/sbin ./Nginx -t
4、http代理配置@H_301_2@
5、https支持,需要配置ssl与证书(证书可以阿里云自行申请,并做好域名解析)@H_301_2@
@H_301_2@