此过程所用到的工具 mobaxterm;
nginx是提前在服务器上部署好的;
1、将前端项目拖到/usr/local/nginx/html/中
2、进入conf配置文件
[root@localhost /]# cd usr/local/nginx/conf
[root@localhost conf]# vi nginx.conf
3、修改conf配置文件
server {
#启动后的端口
listen 80;
#启动时的地址
server_name 192.xxx.xx.xxx;
#编码(不是utf-8建议改一下,不然会报错乱码)
charset utf-8;
#访问日志
#access_log logs/host.access.log main;
location / {
#nginx下html文件夹,上述域名会访问此文件夹下的文件
root html/nginxtest;
index index.html index.htm;
}
4、测试配置是否正确
[root@localhost conf]#