web端拷貝證書(shū)與密鑰
scp -rp -P52113 /application/nginx/conf/key 10.0.0.5:/application/nginx/conf/
在nginx負(fù)載均衡服務(wù)端配置
vim /application/nginx/conf/nginx.conf
worker_processes 2; error_log logs/error.log; events { worker_connections 65535; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream server_pools { server 10.0.0.200:443 weight=1 max_fails=3 fail_timeout=10; #server 10.0.0.8:443 weight=1 max_fails=3 fail_timeout=10; #server 10.0.0.9:443 weight=1 max_fails=3 fail_timeout=10; } server { listen 80; server_name localhost; rewrite ^(.*)$ https://$host$1 permanent; } server { listen 10.0.0.5:443; server_name www.abc.com; #開(kāi)啟 https 注意要添加在server區(qū)塊 不能在http區(qū)塊中放置 ssl on; ssl_certificate /application/nginx/conf/key/server.crt; ssl_certificate_key /application/nginx/conf/key/server.key; location / { proxy_pass https://server_pools; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } } }
#檢查nginx負(fù)載均衡配置
/application/nginx/sbin/nginx -t
#重啟nginx負(fù)載均衡
/application/nginx/sbin/nginx -s stop
/application/nginx/sbin/nginx
瀏覽器訪問(wèn)測(cè)試
注意修改hosts對(duì)應(yīng)的是負(fù)載均衡的IP地址信息
訪問(wèn)測(cè)試
訪問(wèn)結(jié)果
標(biāo)簽:股票 烏海 岳陽(yáng) 紅河 四川 臨沂 鎮(zhèn)江
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《如何通過(guò)nginx負(fù)載均衡跳轉(zhuǎn)https》,本文關(guān)鍵詞 如何,通過(guò),nginx,負(fù)載,均衡,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。