0
点赞
收藏
分享

微信扫一扫

使用nginx在Windows部署网站https服务


nginx简介

​​nginx 百度百科​​

申请https证书

这个在腾讯云之类的服务商都有免费版,这里以腾讯云的为例,申请后下载打开nginx目录

使用nginx在Windows部署网站https服务_腾讯云


打开后有两个文件,这就是我们后面所要导入的,不同服务商申请的可能后缀名可能不同

使用nginx在Windows部署网站https服务_ci_02

下载nginx

​​http://nginx.org/​​ 下面是nginx的各版本,可以下载 稳定版 Stable version

使用nginx在Windows部署网站https服务_https_03


下载完毕后解压

使用nginx在Windows部署网站https服务_腾讯云_04


配置文件

使用nginx在Windows部署网站https服务_腾讯云_05

下面修改的参数有:
server_name: 域名/ip;
ssl_certificate xxx.crt; #申请的https证书
ssl_certificate_key xxx.key; #申请的https证书
proxy_pass http://127.0.0.1:8082/; # 本地访问接口

server {
listen 443 ssl;
server_name lgch.xyz; #域名

ssl_certificate xxx.crt;
ssl_certificate_key xxx.key;

#ssl_certificate cert.pem;
#ssl_certificate_key cert.key;

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;

ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location / {
#root html;
#index index.html index.htm;
proxy_pass http://127.0.0.1:8082/; # 本地访问接口
}
}

上边的server可以设置多个,若解析多个域名到本服务器,将域名写到server_name就可以解析到不同的端口了。


举报

相关推荐

0 条评论