步驟一 下載安裝包
成都創(chuàng)新互聯(lián)服務(wù)項(xiàng)目包括敦化網(wǎng)站建設(shè)、敦化網(wǎng)站制作、敦化網(wǎng)頁(yè)制作以及敦化網(wǎng)絡(luò)營(yíng)銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,敦化網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到敦化省份的部分城市,未來相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
????http://nginx.org/en/download.html , 下載nginx-1.16.1.zip
????在控制臺(tái)cmd中進(jìn)入解壓目錄運(yùn)行指令 start nginx
????http://slproweb.com/products/Win32OpenSSL.html????下載OpenSSL工具生成證書
步驟二 創(chuàng)建SSL證書
????http://slproweb.com/products/Win32OpenSSL.html 下載OpenSSL?
? ? 創(chuàng)建私鑰????openssl genrsa? -out server.key 2048?
????創(chuàng)建csr證書????openssl req -new -key server.key -out server.csr
????生成crt證書????openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
步驟三 配置nginx下的nginx.conf配置文件
??? server {
??????? listen?????? 80?? ssl;#配置ssl加密
??????? server_name? localhost;
??
??????? ssl_certificate????? F:/example/cpp-httplib-build/nginx-1.16.1/server.crt;? # 這個(gè)是證書的crt文件所在目錄
??????? ssl_certificate_key? F:/example/cpp-httplib-build/nginx-1.16.1/server.key;? # 這個(gè)是證書key文件所在目錄
??ssl_session_cache??? shared:SSL:1m;
??ssl_session_timeout? 5m;
??ssl_ciphers? HIGH:!aNULL:!MD5;
??ssl_prefer_server_ciphers? on;
??
??????? #charset koi8-r;
??????? #access_log? logs/host.access.log? main;
??????? location / {
??????????? root?? html;
??????????? index? index.html index.htm;
??????? }
??????? #error_page? 404????????????? /404.html;
??????? # redirect server error pages to the static page /50x.html
??????? #
??????? error_page?? 500 502 503 504? /50x.html;
??????? location = /50x.html {
??????????? root?? html;
??????? }
??????? # proxy the PHP scripts to Apache listening on 127.0.0.1:80
??????? #
??????? #location ~ \.php$ {
??????? #??? proxy_pass?? http://127.0.0.1;
??????? #}
??????? # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
??????? #
??????? #location ~ \.php$ {
??????? #??? root?????????? html;
??????? #??? fastcgi_pass?? 127.0.0.1:9000;
??????? #??? fastcgi_index? index.php;
??????? #??? fastcgi_param? SCRIPT_FILENAME? /scripts$fastcgi_script_name;
??????? #??? include??????? fastcgi_params;
??????? #}
??????? # deny access to .htaccess files, if Apache's document root
??????? # concurs with nginx's one
??????? #
??????? #location ~ /\.ht {
??????? #??? deny? all;
??????? #}
??? }
步驟四重啟服務(wù)
????nginx -s reload
步驟五配置host文件C:\Windows\System32\drivers\etc 路徑下
????127.0.0.1????????? mynginx.cn? #需要配置的域名