Global Static Files (1)
Some static files used in different applications may be the same, such as the favicon icon and custom HTML files.
By putting these static files in Global Static Files, you can reference them in an application whenever you need them.
First, we upload a favicon icon to the Global Static Files:
This page lists all existing global static files.
Upload File button to upload a new one.
It’s very easy. Upload a favicon icon and write the label name of the static file.
Files come in two types. One is static files similar to the favicon icon, the other is custom HTML code, which can be used for Custom Error Page of the application.
Please note that the size of the uploaded file must not exceed 32 KB to successfully upload it.
Select to upload one favicon icon with the label name openresty.
Click the Save button on the bottom right-hand corner after uploading the icon, and a global static file is now successfully uploaded.
You can see information about the newly added file on the Global Static File page:
Then, create an application to see how to refer this static file:
Newly add a
Page Rules and select static file in
Select the favicon icon just uploaded and then Save:
Now, you can reference a global static file in an application.
But the release process is needed to make it work on the edge node. As for details about the release, no further explanation is necessary.
Now, verify as below:
$ curl -i -H 'host: rewrite-rule-test.com' 126.96.36.199/404.html HTTP/1.1 404 Not Found Server: openresty+ Date: Mon, 21 Jan 2019 16:00:43 GMT Content-Type: text/html Content-Length: 166 Connection: keep-alive <html> <head><title>404 Not Found</title></head> <body bgcolor="white"> <center><h1>404 Not Found</h1></center> <hr><center>openresty</center> </body> </html>
Indeed, the favicon icon is in the returned value.
What will happen if we try to delete this global static file?
Return to the Global Static Files page:
Then, delete the uploaded static file:
The above error prompt pops up as the static file being used by the application cannot be deleted.