How nginx matches different static resource directories based on paths
location /console/ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
{
root /opt/jenkins/workspace/little_garden_web/console;
index /opt/jenkins/workspace/little_garden_web/console/index.html;
expires 30d;
}
location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
{
root /opt/jenkins/workspace/little_garden_web/dist;
expires 30d;
}
I hope that when the path contains console, a special static resource directory is accessed, and everything else is obtained from another one. I don’t know how to write the configuration file
You can take a closer look at some configurations of nginx regarding location and provide a method