http://localhost:8085/eazymesozoic/
例如我要在访问地址中增加eazymesozoic字段,那么我就要在nginx中进行配置。
location / {
root D:/vue/vuepro/dist;
# root html/dist;
try_files $uri $uri/ @router; # 配置使用路由
index index.html index.htm;
}
location /eazymesozoic/ {
proxy_pass http://localhost:8085/;// 代理地址
}
proxy_pass ‘将要被代理的地址’
当我们访问 http://localhost:8085/eazymesozoic/ 时,我们所有访问的项目将被转到 http://localhost:8085/ ,也就是说我们访问的http://localhost:8085/eazymesozoic/ 和 http://localhost:8085/ 其实是一个项目。