fastdfs升级为https加密存取

HTTPS 可以给用户带来更安全、更好隐私保护的网络体验,目前各大浏览器都在积极推进 HTTPS 的普及。

作为文件传输的fastdfs,为了整套环境的加密、安全,fastdfs也可能需要升级成https访问。那么,如何修改fastdfs配置使其实现https访问存取呢。

首先:修改fastdfs的配置文件

[root@nginx fdfs]# tree
.
|-- client.conf
|-- client.conf.sample
|-- http.conf
|-- mime.types
|-- mod_fastdfs.conf
|-- storage.conf
|-- storage.conf.sample
|-- tracker.conf
`-- tracker.conf.sample

修改其中的tracker.conf ,storage.conf ,client.conf。均修改为443端口。

[root@nginx fdfs]# grep http |grep server_port tracker.conf
http.server_port=443
^C
[root@nginx fdfs]# grep http |grep server_port storage.conf
http.server_port=443
^C
[root@nginx fdfs]# grep http |grep server_port client.conf 
http.tracker_server_port=443
^C

将原来的nginx配置成https,nginx需增加ssl模块。

修改成如下配置:

  # HTTPS server

    server {
        listen       443 ssl;
      server_name  localhost;


        ssl_certificate /usr/local/nginx/conf/ssl/server.crt;
        ssl_certificate_key /usr/local/nginx/conf/ssl/server.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
            root   html;
            index  index.html index.htm;
               }
        location ~/group1/M00 {root /home/data/fastdfs/data;ngx_fastdfs_module;}

    }

测试:只是测试使用的随机生成的证书,所以浏览器显示证书风险,但是http已经升级成https


  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值