欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

nginx ssl免密碼重啟教程詳解

 更新時(shí)間:2017年01月13日 15:10:23   投稿:mrr  
這篇文章給大家介紹了nginx 如何啟動(dòng)以及nginx ssl 免密碼重啟 的方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友參考下吧

一、nginx如何啟動(dòng)

1、HTTP和HTTPS的區(qū)別

https協(xié)議需要到ca申請(qǐng)證書(shū),一般免費(fèi)證書(shū)很少,需要交費(fèi)。

http是超文本傳輸協(xié)議,信息是明文傳輸,https 則是具有安全性的ssl加密傳輸協(xié)議。

http和https使用的是完全不同的連接方式,用的端口也不一樣,前者是80,后者是443。

http的連接很簡(jiǎn)單,是無(wú)狀態(tài)的;HTTPS協(xié)議是由SSL+HTTP協(xié)議構(gòu)建的可進(jìn)行加密傳輸、身份認(rèn)證的網(wǎng)絡(luò)協(xié)議,比http協(xié)議安全。

所以在涉及到賬戶(hù)、金錢(qián)等敏感信息交互的時(shí)候使用HTTPS是個(gè)不錯(cuò)的選擇。

2、申請(qǐng)證書(shū)

申請(qǐng)SSL證書(shū)過(guò)程就不多說(shuō)了。挺簡(jiǎn)單的,本文主要是在nginx上配置ssl證書(shū)實(shí)現(xiàn)https訪(fǎng)問(wèn)。

將key和證書(shū)上傳到服務(wù)器。

3、nginx配置

 代碼如下

server {
listen 443;
#listen [::]:80;
server_name passport.ddhigh.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/passport.ddhigh.com;
include other.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
ssl on;
ssl_certificate /root/crt/server.crt;
ssl_certificate_key /root/crt/server.key;
access_log /home/wwwlogs/passport.ddhigh.com.log access;
}

/root/crt是我的證書(shū)目錄,各位讀者可以根據(jù)實(shí)際情況更改。

二、nginx ssl 免密碼重啟

設(shè)置ssl之后每次重啟nginx都需要手動(dòng)輸入證書(shū)密碼,非常麻煩,一旦輸出就要重來(lái)。

利用openssl可以將有密碼的私鑰轉(zhuǎn)化為免密碼的私鑰。

openssl rsa -in server.key -out server.key.nopassword

nginx配置ssl的時(shí)候?qū)erver.key的路徑配置為server.key.nopassword的路徑即可。

以上所述是小編給大家介紹的nginx ssl免密碼重啟教程詳解,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論