下載證書和key放置在nginx配置文件同級目錄下,然后添加配置內容,監聽443端口,如果本地443端口被占用,可以使用其他端口測試。
server {
listen 443;
server_name www.domain.com; #填寫綁定證書的域名
ssl on;
ssl_certificate 1_www.domain.com_bundle.crt;
ssl_certificate_key 2_www.domain.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照這個協議配置
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照這個套件配置
ssl_prefer_server_ciphers on;
location / {
root html; #站點目錄
index index.html index.htm;
}
# 接口反向代理
location / {
proxy_pass https:xxxxx;#測試服務器地址
proxy_set_header Host $host;
}
}
