This article is also known as: Pagoda uses pm2 to start the node service and bind the domain name
First refer to the author大水瓜: <span style="color: rgb(127, 127, 127);">https://www.bilibili.com/video/av67066415?t=91</span>
Get a general understanding of the process;
Then refer to the author Zhuying Pingxi: <span style="color: rgb(127, 127, 127);">https://www.bwmelon.com/archives/27/</span>
Follow along;
# 5. Mapping program (the fifth step of synchronizing Big Watermelon)
No need here Limit the mapped port number, such as api.no0a.cn:3000 written by the author 大西瓜
, which can be written as: api.no0a.cn
;
After the mapping is completed, you can see an extra site in the website list of the panel;
It is worth noting that, for example, my own project is based on port 4000, then
Need to open port 4000 (Both Pagoda and Alibaba Cloud security groups need to be opened)
You need to access the api like this:
api.no0a.cn:4000
# 6. Domain name reverse generation (sixth step of synchronizing Big Watermelon)
Always cannot access the api when actually accessing it api.no0a.cn:4000/api/login
This way, it is a bit ugly.
As written by the author 大西瓜, just configure it:
location / { proxy_pass http://127.0.0.1:4000; }
Like this You can access our api through port 80
# 7. Configure https (the seventh step of synchronizing Big Watermelon)
This step is even simpler, directly Download the certificate from Alibaba Cloud SSL, then copy and paste the certificate content into the SSL configuration of the Pagoda site
# 8. Finally