Openlitespeed /litespeed deny methods to access folders and files
Openlitespeed /litespeed deny methods to access folders and files
It's very simple, litespeed/openlitespeed is compatible with apache.htacess,
Just write the rule to the.htacess file
Alternatively, add the rules manually through the litespeed/openlitespeed webGUI console
Disabling access to a specified directory, such as bak
RewriteRule ^bak/.*$-[F,L]
This makes all files in the bak directory inaccessible
Restrict access to all files of specified types such as.log and.db files
RewriteRule ^/.*\.(log|ini|db|env)$-(F,L)
It's as simple as that
But it's important to note that the rules are executed from the top down
Here's the problem, assuming the site is accessed through JAVA on the back end of the proxy
If backend JAVA does not restrict access to these files
The rules above should be written in the first article, and the rules for the proxy backend JAVA should be written later.
Of course, when testing, I found that this setup caused a bit of a delay in the site
To learn more about litespeed, see another litespeed article
Official lopenlitespeed documentation