0%

nginx | https 绑定端口提供 restful api 服务

首先把域名解析到机器上,这里假设是 xxx.com

然后开启,restful api 服务,这里绑定的端口是 8081

nginx 可以这样配置。

1
2
3
4
5
6
7
8
9
10
11
server {
#listen 443;
server_name 域名;
listen 443 ssl;
#listen [::]:443 ssl default_server;
ssl_certificate /home/ubuntu/https/fullchain.crt;
ssl_certificate_key /home/ubuntu/https/private.pem;
location / {
proxy_pass http://127.0.0.1:8081/;
}
}
请我喝杯咖啡吧~