1.Vue项目配置
router/index.js
添加mode为history
base的shiyue41为打包后的项目名字
2.使用nginx配置vue项目
1.下载nginx
sudo apt-get install nginx
2.启动nginx
service nginx start
报错处理
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
apache2不能和nginx一起使用
关掉apache2和杀掉所有的80端口,解决
sudo /etc/init.d/apache2 stop
lsof -i tcp:80
kill -9 pid端口号
3.开启防火墙
ufw allow 80
4.cd到nginx配置目录
cd /etc/nginx/sites-available
5.编辑配置文件
sudo vim default
红线为项目名字
6.测试nginx配置是否正确
sudo nginx -t
7.nginx无间断服务重启
nginx -s reload
or
systemctl reload nginx.service
1.Nginx启动、重启、关闭/Nginx开启启动配置
2.linux/unbunt nginx 卸载重装
3.History Router Nginx 配置
4.nginx 启动报错:Job for nginx.service failed because the control process exited with error code
5.Vue后端配置例子