一段ngnix 代理
server {
listen 8084;
server_name localhost;
location / {
proxy_pass http://localhost:7777;
}
location ^~ /_report {
try_files $uri /index.html index.html;
alias E:/workspace/product_factory_report/client/dist/;
}
location ~* \.(pdf|png)$ {
root E:\workspace\product_factory_report\client\dist; #默认的图片路径,只要后缀是以上的都会到这个路径下搜索
}
location /productFactoryReportAssets {
alias E:/workspace/product_factory_report/client/dist/productFactoryReportAssets/;
}
location /api {
proxy_pass http://localhost:7777;
}
location ^~ /api/_report {
proxy_pass http://localhost:7000;
}
}