nginx(windows)发布Vue-cli打包后的dist-局域网

一:下载nginx

这是我的版本1.15.2链接:https://pan.baidu.com/s/1nP2eN9N_aHW58vJkod59BA

二:更改

打开G:\nginx-1.15.2\conf\nginx.conf修改里面的内容

server {
listen       8088;  #要监听的端口号
server_name  192.168.99.45;   #你的IP地址,也可以写成localhost

#charset koi8-r;

#access_log  logs/host.access.log  main;

location / {
root   G:\dist;  #这里是你打包后的dist路径,注意不能有中文哦,不然会报错的
index  index.html index.htm;
try_files $uri $uri/ /index.html;  #这里是为了Vue的history模式
}

............#其他的一些多余的不在赘述,因为我的压缩包里面的配置已经写好了

三:打开网址

浏览器打开网址就行,输入:192.168.99.45:8088

猜你喜欢

转载自blog.csdn.net/qq_36022290/article/details/84188267