先申请证书,阿里云就可以申请免费的证书,不过需先购买阿里云的域名
http nginx
server {
listen 443 ssl;
server_name wechat.futve.com;
ssl_certificate /root/label-service/3352680_wechat.futve.com.pem;
ssl_certificate_key /root/label-service/3352680_wechat.futve.com.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
#禁止在header中出现服务器版本,防止黑客利用版本漏洞攻击
#server_tokens off;
#如果是全站 HTTPS 并且不考虑 HTTP 的话,可以加入 HSTS 告诉你的浏览器本网站全站加密,并且强制用 HTTPS 访问
#fastcgi_param HTTPS on;
#fastcgi_param HTTP_SCHEME https;
#access_log /usr/local/nginx/logs/httpsaccess.log;
location / {
proxy_pass http://localhost:8005;
}
location /api {
proxy_pass http://127.0.0.1:9000/art/api/action;
}
}