How to match all files with or without extension, except those with the extension txt, pdf, jpeg.
On my Nginx configuration this downloads all the files without any restriction.
location ~ .+(?<!.pdf|.txt|.jpeg)$ {
auth_request /auth.php;
error_page 401 = @login;
}
Thanks
2
Answers
Solved I auth.php was not included as an exception which would cause a loop.
What about defining two locations? E.g.