Whitelisting files with certain extensions

ST smntov at gmail.com
Thu Aug 10 13:29:14 UTC 2017


Hello,

we had following problem: one of the developers has saved a .php file
as .php.old. This file, if requested directly, was offered by nginx for
download and thus exposed. What is the right way to solve this?

1. initial idea was to whitelist all the legitimate file extensions that
we use and block the rest. Is this the right approach? If yes - what is
the best way to do this?

1.1 we have one directory that has legitimate files without any
extension that we also want to serve... how to make an exception for
this directory?

Thank you!



More information about the nginx mailing list