ubuntu 下nginx安装 并支持https协议

项目中需要用到https服务,所以对Nginx进行了https服务的配置支持
下载nginx压缩文件,进行编译安装(可以设置相关的编译参数,按需设置)

文章目标:nginx同时支持:http 与 https协议
下载目录:/usr/local/nginx-1.9.7.tar.gz
安装目录:/usr/local/nginx

1、解压

     tar -zxvf nginx-1.9.7.tar.gz

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、 测试安装是否成功

    cd /usr/local/nginx/sbin
     ./nginx -t    
     

4、http代理配置

《ubuntu 下nginx安装 并支持https协议》
5、https支持,需要配置ssl与证书(证书可以阿里云自行申请,并做好域名解析)

《ubuntu 下nginx安装 并支持https协议》

    原文作者:jessy
    原文地址: https://segmentfault.com/a/1190000011222960
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞