如果你想使用 Nginx 部署 Vue 工程,首先需要确保 Nginx 已经安装完成。然后,你需要创建一个 Nginx 配置文件,通常命名为 nginx.conf
,内容如下:
server {
listen80;
server_name localhost;
location / {
root /path/to/vue/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}