1.nginx sets up a static file server for placing files packaged by webpack. But the zip under the static directory static prompts 404 for each download, and other types of files like .json .md can be downloaded normally.
2.nginx static server is mainly configured as follows
server {
listen 80;
server_name xxx.xx.com;
location / {
root /home/www;
index index.html index.htm;
if ($request_filename ~* ^.*?/.(zip|apk)$) {
add_header Content-Disposition: "attachment;";
}
}
}
3.nginx log is as follows:
[05/Jun/2018:06:54:49 +0000] "GET /static/test/data.zip HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
4.