3D development -AR.js Nginx HTTPS service building

Nginx support HTTPS

Nginx-HTTPS

SSL Certificate Installation

S1. Installation OpenSSL

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

S2. Set Environment Variables

Variable name: OPENSSL_HOME

Variable value: D: \ OpenSSL-Win64 \ bin;

Path After adding:% OPENSSL_HOME%

S3. Generate a certificate

// create a private key

openssl genrsa -des3 -out private.key 1024

// Create a certificate csr

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

// copy and rename private.key.org private.key

// remove the password

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

// generate crt certificate

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

Nginx-windows configuration

server {

    listen 443 ssl; # port

    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

Guess you like

Origin www.cnblogs.com/zhen-android/p/11032768.html