1. 
        

          產品中心 業內新聞 案例中心 視頻中心

          通過Nginx訪問的https的5121轉向到http的5021 通過Nginx訪問的https的5121轉向到http的5021

          通過Nginx訪問的https的5121轉向到http的5021

          分類:產品中心 產品手冊 實施方案 746

          通過Nginx訪問的https的5121轉向到http的5021

           

          Oifilewebs 是http ,5021 端口

          我們小程序部署后,必須采用 https 訪問,因此若不做處理,小程序直接下載或瀏覽文件會造成無法瀏覽或下載的現象

           

          解決方法:

          • 在OIFilewebs的服務器上部署Nginx
          • Nginx監聽5121端口,采用 ssl 模式
          • 之后通過 Nginx將訪問 5121端口的,轉接到 5021

           

          Nginx的conf 文件

          events {

          worker_connections? 1024;? ## Default: 1024

          }

           

          http {

          client_max_body_size 100m;

           

          server {

          listen? 5121 ssl;

          # 這個file.activesoft.cn有ssl證書的域名

          server_name file.activesoft.cn;

           

          # 這個是證書的crt文件所在目錄

          ssl_certificate????? ? ../ssl/FullSSL.crt;

          # 這個是證書key文件所在目錄

          ssl_certificate_key???? ../ssl/SSL.key;

           

          ssl_session_cache??? shared:SSL:1m;

          ssl_session_timeout? 5m;

           

          ssl_ciphers? HIGH:!aNULL:!MD5;

          ssl_prefer_server_ciphers? on;

           

          location / {

          index index.html index.htm index.php;

          proxy_redirect off ;

          proxy_set_header Host $host;

          proxy_set_header X-Real-IP $remote_addr;

          proxy_set_header REMOTE-HOST $remote_addr;

          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

          proxy_connect_timeout 600;

          proxy_send_timeout 600;

          proxy_read_timeout 600;

          proxy_buffer_size 1600k;

          proxy_buffers 4 3200k;

          proxy_busy_buffers_size 6400k;

          proxy_temp_file_write_size 6400k;

          proxy_max_temp_file_size 128m;

          proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;

           

          # 我們將 Https 對 5121 的訪問轉換到:http的 5021 (oifilewebs端口上)

          proxy_pass http://127.0.0.1:5021;

          }

          }

          }

           

          注意:Conf 文件修改后,要重啟 nginx服務

           

          針對文件服務器配置也需要做調整

          注意: url 定義是

          https://mfile.activesoft.cn:5121

          這個,對應的是 Nginx的 5121 的ssl 端口

          標簽:手冊方案 上一篇: 下一篇:
          展開更多
          預約軟件體驗

          loading...

          日本高清一二三区