The invention discloses a static file
access method and device based on Nginx. The method comprises the following steps executed at an
application server side: receiving a page access request sent bya
client; determining a page corresponding to a page access request, wherein the page contains the original URL; and returning the page to a
client after performing the
encryption processing in the original URL included in the page. The method comprises the following steps executed at a Nginx
server side: receiving the encrypted URL sent by the
client; and decrypting the encrypted URL to acquire the original URL; acquiring a static file corresponding to the original URL, and sending the data in the static file to the client. The
application server provided by the invention encrypts the staticfile in a saving path in the Nginx
server, and sends the URL in a
ciphertext way to the client, thereby enabling the client to access the static file in the Nginx
server according to the URL in the
ciphertext way, and then the problem of data leakage caused by intercepting the URL is avoided, and the security of the Nginx server is improved.