安装个 Nginx 配置 vue 还是折腾了会。
下载源码地址:
Index of /download/
http://nginx.org/download/nginx-1.20.2.tar.gz
解压
./configure
make
make install
echo 'export PATH=$PATH:/usr/local/nginx/sbin' >> ~/.bashrc
source ~/.bashrc
默认配置文件目录在: /usr/local/nginx/conf
这个配置文件里面可以配置 root 目录,指向到 vue 的 dist 目录
nginx -c /usr/local/nginx/conf/nginx.conf
或者直接 nginx (会使用默认配置)