HTTPS 证书配置

#
# HTTPS server configuration 
# 配置文件默认位于 [root@hexingxing conf.d]# pwd
# /etc/nginx/conf.d
#

server {
listen 443;
ssl on;
server_name  yourname.com; #指向服务器的域名
root         /yourdir/httpfile; #网页文件存放在位置
index index.php index.html index.htm;
ssl_certificate   /etc/nginx/sslkey/yourpemcode.pem; #cert.pem 文件,注意文件的位置
ssl_certificate_key  /etc/nginx/sslkey/yourkeycode.key; #cert.key 文件,注意文件的位置
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;
location / {
root /yourdir/httpfile; #网页文件存放在位置
index index.php index.html index.htm;
}



    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        fastcgi_param  SCRIPT_FILENAME  /yourdir/httpfile$fastcgi_script_name; #网页文件存放在位置
        include        fastcgi_params;
    }

}

#
#    error_page 404 /404.html;
#        location = /40x.html {
#    }
#
#    error_page 500 502 503 504 /50x.html;
#        location = /50x.html {
#    }
#}

1 条评论

昵称
  1. Pingback: HTTPS 时代,使用 Certbot (Let’s Encrypt) – 何小湘