首先把域名解析到机器上,这里假设是 xxx.com
。
然后开启,restful api
服务,这里绑定的端口是 8081
。
nginx
可以这样配置。
1 2 3 4 5 6 7 8 9 10 11
| server { server_name 域名; listen 443 ssl; ssl_certificate /home/ubuntu/https/fullchain.crt; ssl_certificate_key /home/ubuntu/https/private.pem; location / { proxy_pass http://127.0.0.1:8081/; } }
|