项目中须要用到https服务,因此对Nginx进行了https服务的配置支持
下载nginx压缩文件,进行编译安装(能够设置相关的编译参数,按需设置)nginx
文章目标:nginx同时支持:http 与 https协议
下载目录:/usr/local/nginx-1.9.7.tar.gz
安装目录:/usr/local/nginx测试
一、解压阿里云
tar -zxvf nginx-1.9.7.tar.gz
二、编译spa
/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
三、 测试安装是否成功代理
cd /usr/local/nginx/sbin ./nginx -t
四、http代理配置code
五、https支持,须要配置ssl与证书(证书能够阿里云自行申请,并作好域名解析)ip