centOS 安装配制 nginx 443

1,wget https://unit.nginx.org/?_ga=2.229659228.1995603452.1586104412-1725938561.1586104412

2, yum install nginx

3,  cd /etc/nginx/conf.d

4, touch aa.conf 创建配制文件

5,配制  (提前把域名解析到本服务器)

server {
    listen       443 ssl;
    server_name  api.hao.com

    ssl                  on;
    ssl_certificate      /etc/nginx/ssl/api.hao.pem;
    ssl_certificate_key  /etc/nginx/ssl/api.hao.key;
    client_max_body_size 10m;
    ssl_session_timeout  5m;
    ssl_session_cache shared:SSL:50m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2  SSLv2 SSLv3;
     ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
     ssl_prefer_server_ciphers   on;
     location / {
        root   /usr/share/nginx/html/ceshi;
        index  index.html index.htm index.php;
     }
}
 

访问吧, https://aaa.aaa.com  示例,我的是二级域名,你根据你的情况来 

你可能感兴趣的:(linux,centos)