我在三个不同的目录中有不同的文件。
我想阻止访问其中的所有文件(也阻止目录列表)。
这样,我会阻止,例如:
/a/b/文件
/a/c/文件
/a/d/文件
不管是什么文件扩展名...
这就是我正在尝试的:
location /a/(b|c|d) {
allow 1.2.3.4; #IP
deny all;
return 403;
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用。
有没有办法自动重命名接收器上的现有文件?例如:如果filename
已经存在,它会自动重命名filename
为类似filename_001
,filename_002
等等....
到目前为止,我所拥有的是:
$ rsync -rh --progress --stats --exclude '.thumb' \
--update --perms /origin /destination
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我知道 rsync 必须--ignore-existing
“跳过接收器上存在的更新文件”,但我想我需要的是类似--rename-existing
.
我想在没有任何查询字符串的情况下对站点的索引进行 301 重写。像这样:
http://example.com/anypage.asp?anyvar=anyvalue
到:
http://example.com/
这是一个真实的例子:
http://atipico.com.br/conteudo.asp?P_categ=23
我试图按照这个:http : //wiki.nginx.org/NginxHttpRewriteModule#rewrite
(评论是我的尝试):
location ~ /conteudo\.asp(.*)$ {
#rewrite ^ / permanent;
#rewrite ^ /? permanent;
#return 301 /;
#return 301 /?;
#if ($args) { return 301 /; }
}
Run Code Online (Sandbox Code Playgroud)
它总是重写为 http://atipico.com.br/?P_categ=23
有任何想法吗?