My website is built using Nginx. I set up auth_basic method for password verification on a PDF file named test.pdf.
location /test.pdf
{
auth_basic "Please input password";
auth_basic_user_file /etc/nginx/passwd;
}
The test found that this PDF file can be downloaded normally after entering the correct password on various PC browsers, Safari on iOS, and Chrome and Edge on Android. However, in Huawei browser and Quark browser on Android, after using the browser to open the URL and entering the correct password, the download fails.
Huawei browser on Android does not give an error message, and the error message given by Quark browser is "401 Not Authorized". It looks like the auth_basic authentication information is not being transferred to the browser's download process.
How to solve this problem? Is this a nginx server side configuration issue? Or is it a problem with the browser on Android?