[TOC] ## **生成自签名证书** https://www.cnblogs.com/hnxxcxg/p/7610582.html ``` \# 使用openssl工具生成一个RSA私钥 openssl genrsa -des3 -out server.key 1024 \# 生成CSR(证书签名请求) openssl req -new -key server.key -out server.csr \# 删除私钥中的密码 openssl rsa -in server.key -out server.key \# 生成自签名证书 openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt ``` 配置https服务 : http://nginx.org/en/docs/http/confifiguring_https_servers.html ``` server { listen 443 ssl; server_name fox.yuanma.com; ssl_certificate server.crt; ssl_certificate_key server.key; location / { proxy_pass http://backend/; } } ```