我有一个脚本来设置下载主机的一些限制。 这个脚本给了我一些文件(index.php|dl.php|config.php) ,我必须把它们放在我的下载主机上。 脚本也有这些htaccess代码:
Order allow,deny Deny from All <FilesMatch "^(index\.php)?$"> Allow from All </FilesMatch> <FilesMatch "^(dl\.php)?$"> Allow from All </FilesMatch>
但我的networking服务器是NGINX。 我应该把什么重写代码放在nginx.conf? 顺便说一下,我想对vip文件夹mysomain.com/vip设置限制。 我把(index.php | dl.php | config.php)`放在上面。
我用它,它终于工作。
location ~ ^(index\.php)?$ { allow all; } location ~ ^(dl\.php)?$ { allow all; } location /vip { deny all; }
PS:我再次遇到这些代码的一些问题。 所以我改变了他们:
error_page 500 /index.php?error=500; error_page 404 /index.php?error=404; error_page 403 /index.php?error=403; location /vip { internal; alias /home/mydirecadmin ACC /domains/dl1.mydomain.com/public_html/vip; }
但是我想知道,安全吗? 我如何设置VIP文件夹内除dl和index.php以外的所有文件和文件夹的限制?