第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

NGINX實現(xiàn)HTTPS的系統(tǒng)需求

標(biāo)簽:
PHP

参考:https://www.cnblogs.com/jingxiaoniu/p/6745254.html


一、NGINX实现HTTPS的系统需求


1、系统所需安装包

openssl openssl-devel


yum install openssl openssl-devel -y


2、nginx编译SSL模块

--with-http_ssl_module


./configure --prefix=/opt/app/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-pcre=/opt/download/pcre-8.38 --with-http_ssl_module


二、全站单向SSL加密

关于SSL/TLS原理请参考 这里,如果你只是想测试或者自签发ssl证书,参考 这里

1、生成一个RSA密钥

# openssl genrsa -des3 -out imoocc.key 1024  //prase为imoocc (记住)


openssl genrsa -des3 -out server.key 1024  //prase为hc123 (记住)


2、通过上面生成的rsa生成一个不需要密码的秘要

# openssl rsa -in imoocc.key -out imoocc_nopass.key

//这样可以用于nginx reload 免密码



Nginx的HTTPS服务



1.下面为配置文件 /usr/local/nginx/conf/vhost/daj.conf


server{

#比起默认的80 使用了443 默认 是ssl方式  多出default之后的ssl

        listen 443 default ssl;

#default 可省略

#开启  如果把ssl on;这行去掉,ssl写在443端口后面。这样http和https的链接都可以用

        ssl on;

#证书(公钥.发送到客户端的)

        ssl_certificate ssl/server.crt;

#私钥,

        ssl_certificate_key ssl/server.key;

#下面是绑定域名

        server_name www.daj.com;

        location / {

#禁止跳转

        proxy_redirect off;

#代理淘宝

proxy_pass https://www.tao.com/;  

        }        

}

server {

listen 443; 

server_name www.imoocc.com;

ssi on;

ssl on;

ssl_certificate /opt/app/nginx/ssl/imoocc.crt; 

#ssl_certificate_key /opt/app/nginx/ssl/imoocc.key; 

ssl_certificate_key /opt/app/nginx/ssl/imoocc_nopass.key;

index index.html index.jsp;

location / { 

proxy_pass http://imoocc_7070_tomcat; 

include proxy_params; 

access_log /opt/logs/nginx/access/myeidser_cn_https.log Jmain; 

}


點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
PHP開發(fā)工程師
手記
粉絲
104
獲贊與收藏
364

關(guān)注作者,訂閱最新文章

閱讀免費(fèi)教程

  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機(jī)會得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消