In the past we all buy server hosting, then the front page and back-end services on the same machine, the domain name resolution to this server, nginx through binding domain, and point to the directory where the front page, front page request interface, configure nginx proxy forwarding, such as matching the '/ xxxx', is forwarded to the back-office services.
But we decided to make the front page (html, js, css, images and other static resources) deployed to (Ali cloud object storage service (Object Storage Service, referred to as OSS), then the background interface allows cross-domain requests.
These are set up, I'll Ant Design Pro project package upload to aliyun oss, everything is normal, but you can not refresh the page, refresh the page on a report this error, the error message: This XML file does not appear to have any style information associated with it. The document tree is shown below.
Figure
The problem with the front-end routing relationship, Ant Design Pro (> = 2.0) using UmiJS, umi is the default Browser History, if you use Hash History, you need to configure:
exportdefault{
history:'hash',
}
If we use the default configuration (Browser History), in the past, we need to configure nginx in:
location / {
# For use with browserHistory
try_files $ on $ a / /index.html;
}
In aliyun oss, we can set up on the basis of -> to set the image back to the source, can achieve such results.
Set as follows:
figure 1
figure 2
After setting takes effect immediately, and then refresh the page to normal.
Reproduced in: https: //www.jianshu.com/p/0bc309057ca6