Django个人博客搭建教程---使用Ubuntu+Nginx部署你的Vue应用
/etc/nginx/nginx.conf添加这一段server {listen8090;server_namewww.guanacossj.com;index index.html;root /home/MyBlog/myblogfront/dist;location / {try_files...
·
/etc/nginx/nginx.conf添加这一段
server {
listen 8090;
server_name www.guanacossj.com;
index index.html;
root /home/MyBlog/myblogfront/dist;
location / {
try_files $uri $uri/ /index.html;
}
}
root表示vue项目build后生成的dist目录,里面有static和index.html两个文件
在vue工程下,我这里是myblogfront,执行
npm run build
访问ip:8090即可
更多推荐
已为社区贡献19条内容
所有评论(0)