windows中;
启动:nginx.exe
关闭:nginx.exe -s stop
配置nginx.conf;
默认的80端口容易冲突;切换81或其他
listen 81;
http里面配置信息;
server {
listen 9001;
server_name localhost;
location ~ /eduservice/ {
proxy_pass http://localhost:8001;
}
location ~ /eduoss/ {
proxy_pass http://localhost:8002;
}
测试
启动项目;F12查看url;发现是配置的端口9001;配置请求转发成功