案例中心 视频中心

通过Nginx访问的https的5121转向到http的5021 通过Nginx访问的https的5121转向到http的5021

通过Nginx访问的https的5121转向到http的5021

分类:产品中心 产品手册 实施方案 255

通过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...