
2010年2月3日
如鼠標移到 class 為 box 的 div 標簽中背景變色
.vbox div:hover{background: #ddd;}
據說 IE6.0、Firefox2.0、Opera 9.23都不支持
posted @
2010-02-24 22:10 流浪汗 閱讀(1975) |
評論 (0) |
編輯 收藏
想改 a 的默認方式,比如:鏈接不要下劃線,鼠標移到上面時有劃線。
css 如
a:hover {text-decoration: underline;}
a:link {text-decoration: none;}
a:visited {text-decoration: none;}
是沒有達到鼠標稱到上面有劃線。
必須改為:
a:link {text-decoration: none;}
a:visited {text-decoration: none;}
a:hover {text-decoration: underline;}
a:hover 放到最后。
posted @
2010-02-24 22:04 流浪汗 閱讀(998) |
評論 (3) |
編輯 收藏
一、介紹
Nginx是俄羅斯人編寫的十分輕量級的HTTP服務器,Nginx,它的發音為“engine X”, 是一個高性能的HTTP和反向代理服務器,同時也是一個IMAP/POP3/SMTP 代理服務器.
二、
Location語法語法:location [=|~|~*|^~] /uri/ { … }
注:
1、~ 為區分大小寫匹配
2、~* 為不區分大小寫匹配
3、!~和!~*分別為區分大小寫不匹配及不區分大小寫不匹配
示例一:
location / { }
匹配任何查詢,因為所有請求都以 / 開頭。但是正則表達式規則將被優先和查詢匹配。
示例二:
location =/ {}
僅僅匹配/
示例三:
location ~* \.(gif|jpg|jpeg)$ {
rewrite \.(gif|jpg)$ /logo.png;
}
注:不區分大小寫匹配任何以gif,jpg,jpeg結尾的文件
三、
ReWrite語法
last - 基本上都用這個Flag。
break - 中止Rewirte,不在繼續匹配
redirect - 返回臨時重定向的HTTP狀態302
permanent - 返回永久重定向的HTTP狀態301
1、下面是可以用來判斷的表達式:
-f和!-f用來判斷是否存在文件
-d和!-d用來判斷是否存在目錄
-e和!-e用來判斷是否存在文件或目錄
-x和!-x用來判斷文件是否可執行
2、下面是可以用作判斷的全局變量
例:http://localhost:88/test1/test2/test.php
$host:localhost
$server_port:88
$request_uri:http://localhost:88/test1/test2/test.php
$document_uri:/test1/test2/test.php
$document_root:D:\nginx/html
$request_filename:D:\nginx/html/test1/test2/test.php
四、
Redirect語法
server {
listen 80;
server_name start.igrow.cn;
index index.html index.php;
root html;
if ($http_host !~ "^star\.igrow\.cn$"
{
rewrite ^(.*) http://star.igrow.cn$1 redirect;
}
}
五、防盜鏈
location ~* \.(gif|jpg|swf)$ {
valid_referers none blocked start.igrow.cn sta.igrow.cn;
if ($invalid_referer) {
rewrite ^/ http://$host/logo.png;
}
}
六、根據文件類型設置過期時間
location ~* \.(js|css|jpg|jpeg|gif|png|swf)$ {
if (-f $request_filename) {
expires 1h;
break;
}
}
七、禁止訪問某個目錄
location ~* \.(txt|doc)${
root /data/www/wwwroot/linuxtone/test;
deny all;
}
轉:http://www.phpchina.com/html/70/t-162870.html,
http://idev.yo2.cn/go/19761.html
posted @
2010-02-03 10:25 流浪汗 閱讀(12018) |
評論 (0) |
編輯 收藏