1、下载nginx
2、配置nginx.conf,listen为端口,root为前端项目文件根目录,location为url后缀访问路径
server {
listen 800;
server_name www.boh.cn;
root E:\\boh-front\\B2C2\\dev\\BtoC\\Server\\front-end\\admin;
#charset koi8-r;
#access_log logs/host.access.log main;
location /api/ {
proxy_pass http://localhost:8080/diet-web-admin/;
proxy_redirect default;
}
location / {
index index.html;
}