国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Nginx > 正文

如何通過nginx負載均衡跳轉https

2024-08-30 12:29:53
字體:
來源:轉載
供稿:網友

web端拷貝證書與密鑰

   scp -rp -P52113 /application/nginx/conf/key 10.0.0.5:/application/nginx/conf/

在nginx負載均衡服務端配置

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;     #開啟 https 注意要添加在server區塊 不能在http區塊中放置    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負載均衡配置

   /application/nginx/sbin/nginx -t

#重啟nginx負載均衡

   /application/nginx/sbin/nginx -s stop
   /application/nginx/sbin/nginx

瀏覽器訪問測試

注意修改hosts對應的是負載均衡的IP地址信息

訪問測試

nginx,負載均衡,https

訪問結果

nginx,負載均衡,https


注:相關教程知識閱讀請移步到服務器教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 滨海县| 黄平县| 余干县| 惠来县| 邢台县| 玛纳斯县| 泸西县| 宁津县| 林周县| 安新县| 巴彦淖尔市| 前郭尔| 麦盖提县| 大港区| 康乐县| 徐闻县| 惠安县| 曲阳县| 汨罗市| 同江市| 临洮县| 嘉荫县| 尉氏县| 苍溪县| 杭锦后旗| 屏东市| 含山县| 荔浦县| 锦屏县| 北辰区| 皋兰县| 峨眉山市| 黄大仙区| 乌什县| 和硕县| 炉霍县| 吴桥县| 穆棱市| 长宁区| 章丘市| 沙河市|