Nginx和Https实战

DBC 1.1K 0

首先申请到证书,然后去把证书下载下来

Nginx和Https实战插图

Nginx配置https证书配置实操

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
​
make
​
make install
​
#查看是否成功
/usr/local/nginx/sbin/nginx -V
温馨提示

以上操作是默认你没有Nginx的操作哈,如果已经有了自行百度如果安装插件,如果是宝塔,那么默认有![aru_5]

Nginx配置https证书

server {
        listen       443 ssl;
        server_name  16web.net;

        ssl_certificate      /usr/local/software/biz/key/4383407_16web.net.pem;
        ssl_certificate_key  /usr/local/software/biz/key/4383407_16web.net.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;
        }
    }
温馨提示

其实只需要下面这三行即可
ssl_certificate /usr/local/software/biz/key/4383407_16web.dbc.pem;
ssl_certificate_key /usr/local/software/biz/key/4383407_16web.dbc.key;
ssl_prefer_server_ciphers on;

发表评论 取消回复
表情 图片 链接 代码

分享