lighttpd做判断的时候可以很灵活,比如:

$HTTP["host"] == "www.example.org" {
  $HTTP["remoteip"] != "10.0.0.0/8" {
   url.access-deny = ( "" )
  }
}


$HTTP数组里面有如下的变量可以引用(官方):
引用
$HTTP["cookie"]
match on cookie
$HTTP["host"]
match on host
$HTTP["useragent"]
match on useragent
$HTTP["referer"]
match on referer
$HTTP["url"]
match on url. If there are nested blocks, this must be the most inner block.
$HTTP["querystring"]
match on querystring, eg, after the ? in this type url: index.php?module=images..
$HTTP["remoteip"]
match on the remote IP or a remote Network (Warning: doesn't work with IPv6 enabled)
$HTTP["scheme"] (Introduced in version 1.4.19)
match on the scheme used by the incoming connection. This is either "http" or "https".
$SERVER["socket"]
match on socket. Value must be on the format "ip:port" where ip is an IP address and port a port number, or ":port" to match port only. Only equal match (==) is supported. It also binds the daemon to this socket. Use this if you want to do IP/port-based virtual hosts.
$PHYSICAL["path"] (Introduced in version 1.5.0)
match on the mapped physical path of the file / cgi script to be served.
$PHYSICAL["existing-path"] (Introduced in version 1.5.0)
match on the mapped physical path of the file / cgi script to be served only if such a file exists on the local filesystem.



原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
Tags:
发表评论
AD
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML 打开UBB 打开表情 隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写
 

阅读推荐

服务器相关推荐

开发相关推荐

应用软件推荐