一.需要下载nginx证书![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/23a7dab67433ce5d6b85b1efd52413a2.jpeg#pic_center)
二.下载nginx稳定版
nginx网址: http://nginx.org/en/download.html
三.配置nginx
在nginx-1.18.0下创建ssl文件,把你ssl证书放进去.
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 443 ssl;
server_name www.xxxxx.com; #域名
#证书的路径
ssl_certificate C:/nginx-1.18.0/ssl/xxxx.pem;
ssl_certificate_key C:/nginx-1.18.0/ssl/xxxx.key;
#ssl_session_cache shared:SSL:1m;
#ssl_session_timeout 5m;
#ssl_ciphers HIGH:!aNULL:!MD5;
#ssl_prefer_server_ciphers on;
location / {
proxy_pass http://www.xxxx.com:8085; #域名和端口
}
}
server {
listen 443 ssl;
server_name www.xxxx.com;
ssl_certificate C:/nginx-1.18.0/ssl/xxxx.pem;
ssl_certificate_key C:/nginx-1.18.0/ssl/xxxx.key;
#ssl_session_cache shared:SSL:1m;
#ssl_session_timeout 5m;
#ssl_ciphers HIGH:!aNULL:!MD5;
#ssl_prefer_server_ciphers on;
location / {
proxy_pass http://www.xxxx.com:8081;
}
}
}