1、Nginx 下载地址
http://nginx.org/en/download.html
2、Conf文件内容配置 conf/nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 806; //监听端口
server_name localhost;
location / {
root E:/Coding/P006/new/P006_VUE/dist; //项目路径
index index.html index.htm;
}
location ^~/prod-api/ { //^~不区分大小写
proxy_pass http://192.168.0.165:8006/; // ★注意结尾中的“/”,否则会报401错误
}
}
}
3、启动
//方式一 根目录中点击 nginx.exe
//方式二 根目录中点击 powershell窗口 进入nginx文件 使用 start nginx