直接粘贴进nginx配置文件,修改域名以及网站目录和ssl证书即可。
server {
listen 443 ssl;
server_name localhost www.yangchao.org;
ssl on;
ssl_certificate D:/phpStudy_PRO/nginx1.5/1.pem;
ssl_certificate_key D:/phpStudy_PRO/nginx1.5/1.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM- SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on;
location / {
root "D:/WWW/web";
index index.php index.html index.htm;
}
location ~ .*\.(php|php5)?$ {
root "D:/WWW/web";
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
#new line
include fastcgi.conf;
}
}