Category Archives: WEB

[转贴] Nginx重定向[Rewrite]配置 for wordpress & Discuz

转贴自:http://srsman.com/2008/08/nginx-rewrite-for-wordpress-and-discuz/ 首先Apache的Rewite规则差别不是很大,但是Nginx的Rewrite规则比Apache的简单灵活多了 Nginx可以用if进行条件匹配,语法规则类似C 注:如果发现设置 rewite 有问题,可以试试设置 server_name_in_redirect off; if ($http_user_agent ~ MSIE) { rewrite ^(.*)$ /msie/$1 break; } 官方文档请点击这里 Rewrite的Flags last – 基本上都用这个Flag。 break – 中止Rewirte,不在继续匹配 redirect – 返回临时重定向的HTTP状态302 permanent – 返回永久重定向的HTTP状态301 WordPress的重定向规则: if (!-e $request_filename) { rewrite ^/(index|atom|rsd)\.xml$ http://feed.shunz.net last; rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last; rewrite ^([_0-9a-zA-Z-]+)?(/.*\.php)$ $2 last; rewrite ^ /index.php last; } 以下为Discuz完整的Rewrite [...]

关于 squid 中的 via 设置

不少 Squid 的配置教程中有提到如果一些网站通过 Squid 访问有问题,可尝试配置 via off 我发现配置后,cache.log 会在 Squid 启动时有下面的警告 WARNING: HTTP requires the use of Via 查了一些资料,主要是说 Via Header 可用于防止使用 proxy 时产生 loop,下面是转贴自 http://www.faqs.org/rfcs/rfc3261.html 的说明: The Via header field indicates the transport used for the transaction and identifies the location where the response is to be sent. A Via header field value is [...]

[转贴] Details about TCP_MISS/000 in Squid access.log

转贴自:http://planet.admon.org/howto/details-about-tcp_miss000-in-squid-access-log/ I noticed some TCP_MISS/000 entries in Squid access_log this afternoon, as what I saw 3 years ago. As we know that TCP_MISS means the URL has no stored objects in cache, and TCP_MISS/000 is the bit usually means aborted, indicating there’s no reply to the request before the client aborted the connection. It might [...]

[转贴]squid 日志详解

转贴自:http://blog.chinaunix.net/u/27383/showart_1099144.html 在squid中access访问日志最为重要,位于/var/log/squid/access.log,常用的记录格式如下 例如: 1217559125.663     21 222.91.241.67 TCP_MEM_HIT/200 501 GET http://www.mytino.com/china/job_pop/marketplace_images/mp_listdivarr.gif – NONE/- image/gif 1217559124.993     17 59.92.59.232 TCP_IMS_HIT/304 274 GET http://www.mytino.com/images/attach_suc.gif – NONE/- image/gif 1217559125.629     94 222.91.241.67 TCP_MEM_HIT/200 501 GET http://www.mytino.com/china/job_pop/marketplace_images/mp_listdivarr.gif – NONE/- image/gif 1217559125.642     13 222.91.241.67 TCP_HIT/200 446 GET http://www.mytino.com/china/job_pop/marketplace_images/mp_listdivbg.gif – NONE/- image/gif 下面来看看意思 logformat squid  %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A [...]

Follow

Get every new post delivered to your Inbox.