The front and rear ends are separated, how to access the back-end static resource folder through URL?

when the front and rear ends are separated, the front end provides API access to the data through the back end, but this is achieved through @ API, that is, giving the front end a URL, if there is a folder of static resources in the back-end project, how can the static folder be accessed through URL?


generally speaking, whether using apache or nginx, or custom server software, the default is to map the local directory to a remote directory and then redirect some requests to a specific entry file, such as index.php.

so if there is a static resource folder remotely, you just need to access it as usual. Only if it is configured to be accessible.


ip access or domain name access is not good? Can only access the file name directly, to be specific, you can save the path.

I tried. OK
http://11.11.136.102:8080/SHXSKH/css/images/common/drop.png


just put the folder address out through the nginx proxy.


then use spring mvc to define static file paths. I'll give you an example of spring boot: https://gitee.com/skyarthur19.

.

principle analysis article: https://codeshelper.com/a/11.

Menu