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
1
2
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
1
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
💘 相关文章
- Openlitespeed /litespeed 配置文件参考收藏
- Openlitespeed /litespeed 常用的伪静态(rewrite)规则大全
- Openlitespeed /litespeed 添加HSTS的方法
- openlitespeed/litespeed禁止访问文件夹和文件的方法
- mediawiki 在网站根目录下的apache/openlitespeed伪静态规则
- LiteSpeed 旗下特色的免费CDN加速服务QUIC.cloud
- 重设litespeed的web管理密码
- Solution to garbled laptop keyboard
- how to do install LibXml2 , LibXslt for centos 7
- How to update the open source http3 server - openlitespeed