I've got several directories with pdf files inside:
/srv/http/A_1
-->/srv/http/A_1/01.pdf
-->/srv/http/A_1/02.pdf
/srv/http/A_2
-->/srv/http/A_2/01.pdf
-->/srv/http/A_2/02.pdf
I need to setup defferent password for every file which I create in directory. I've tried to use auth_basic with "location" directive but when I enter password for the first file I don't need to do it for the next one. When I click there is no password prompt and file open without any problems. So it is only a partial solution.
Just to be clear I need to do something like this in nginx:
1) I open html page with links to pdf files,
2) click on link, password prompt appears,
3) if login and password is correct I can download pdf file,
4) click on the next link and I've got password prompt again... and so on.
/srv/http/A_1
-->/srv/http/A_1/01.pdf
-->/srv/http/A_1/02.pdf
/srv/http/A_2
-->/srv/http/A_2/01.pdf
-->/srv/http/A_2/02.pdf
I need to setup defferent password for every file which I create in directory. I've tried to use auth_basic with "location" directive but when I enter password for the first file I don't need to do it for the next one. When I click there is no password prompt and file open without any problems. So it is only a partial solution.
Just to be clear I need to do something like this in nginx:
1) I open html page with links to pdf files,
2) click on link, password prompt appears,
3) if login and password is correct I can download pdf file,
4) click on the next link and I've got password prompt again... and so on.