Nginx支持HTTPShtml
Nginx-HTTPSlinux |
SSL證書安裝nginx |
S1.安裝OpenSSLweb http://slproweb.com/products/Win32OpenSSL.htmlwindows S2.設置環境變量session 變量名:OPENSSL_HOMEui 變量值:D:\OpenSSL-Win64\bin;spa Path後添加: %OPENSSL_HOME%server S3.生成證書htm // 建立私鑰 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:
http://www.javashuo.com/article/p-oannvjet-x.html // windows
http://www.javashuo.com/article/p-oannvjet-x.html // linux
http://nginx.org/en/docs/http/configuring_https_servers.html // nginx