the express project has been configured with pm2 on the server and can be started successfully. The node port of express is 3000
now you can see the data under the corresponding node api by visiting http://132.232.193.33:3000/about. My nginx currently looks like this:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name csdoker.com;
root /var/www/vue-blog-server/;
-sharp Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:3000;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
this is only configured with the express project vue-blog-server. Now I want to configure a front-end project for vue-blog. How should I match it?
finally, the effect I want to achieve is to visit the first-level domain name csdoker.com and point to the vue-blog project index.html, access the second-level domain name api.csdoker.com/about to get the data of the express project
the current DNS record on Tencent Cloud reads as follows:
Doesalso need to add a second-level domain name record, such as this?
- Host record: api
- record type: a
- Line type: default
- record value: 132.232.193.33