3D开发-AR.js Nginx HTTPS服务搭建

Nginx支持HTTPS

Nginx-HTTPS

SSL证书安装

S1.安装OpenSSL

    http://slproweb.com/products/Win32OpenSSL.html

S2.设置环境变量

变量名:OPENSSL_HOME

变量值:D:\OpenSSL-Win64\bin;

Path后添加: %OPENSSL_HOME%

S3.生成证书

// 创建私钥

openssl genrsa -des3 -out private.key 1024

// 创建csr证书

openssl req -new -key private.key -out private.csr

// 复制private.key并重命名为private.key.org

// 去除密码

openssl rsa -in private.key.org -out private.key

// 生成crt证书

openssl x509 -req -days 365 -in private.csr -signkey private.key -out private.crt

Nginx-windows配置

server {

    listen       443 ssl;   # 端口

    server_name  localhost;

 

    ssl_certificate      C://nginx//ssl//buduhuisi.crt;  # 这个是证书的crt文件所在目录

    ssl_certificate_key  C://nginx//ssl//buduhuisi.key;  # 这个是证书key文件所在目录

 

    ssl_session_cache    shared:SSL:1m;

    ssl_session_timeout  5m;

 

    ssl_ciphers  HIGH:!aNULL:!MD5;

    ssl_prefer_server_ciphers  on;

 

    location / {

      root   html;                  # 这个是指定一个项目所在目录

      index  index.html index.htm;  # 这个是指定首页的文件名

    }

}

 

 

Ref:

     https://www.cnblogs.com/chasewade/p/7661290.html   // windows

     https://www.cnblogs.com/chasewade/p/7661290.html   // linux

     http://nginx.org/en/docs/http/configuring_https_servers.html   // nginx

猜你喜欢

转载自www.cnblogs.com/zhen-android/p/11032768.html