V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  rails3  ›  全部回复第 12 页 / 共 20 页
回复总数  396
1 ... 4  5  6  7  8  9  10  11  12  13 ... 20  
2014-05-30 12:42:09 +08:00
回复了 lookon 创建的主题 酷工作 Android 工程师(在家工作)
soho赞+1
2014-05-29 16:29:55 +08:00
回复了 ansenlee 创建的主题 北京 外地人与狗不得进京-北京 8 年
快快更新
2014-05-29 14:55:55 +08:00
回复了 ansenlee 创建的主题 北京 外地人与狗不得进京-北京 8 年
买过楼主的酱牛肉,味道不错。
2014-05-28 10:02:33 +08:00
回复了 ksc010 创建的主题 分享发现 入了个域名 tao.gift
要做海淘网站?
2014-05-26 15:20:31 +08:00
回复了 paolongtao 创建的主题 Ripple Jed 另起炉灶了
又要发钱了
2014-05-26 11:19:26 +08:00
回复了 zhonghua 创建的主题 程序员 有没有一款基于 nodejs 的类似 V2EX 的开源社区软件
2014-05-23 16:21:57 +08:00
回复了 tamamaxox 创建的主题 问与答 大家一般上哪里买短信的?
我有一朋友专门做短信,你可以联系他qq: 八留302388
2014-05-23 13:28:40 +08:00
回复了 kstsca 创建的主题 Ripple 大家还有多少 XRP?
还剩8000
2014-05-16 15:21:11 +08:00
回复了 baskice 创建的主题 问与答 有会 varnish 设置的吗?求找 bug 首次访问一定 miss
这是我们一个可以使用的配置,varnish 3.x

backend default {
.host = "172.x.x.x";
.port = "8080";
}

sub vcl_recv {

if (req.request == "CACHEPURGE") {
ban("req.http.host == " + regsub(req.http.host, ":6081", "") + " && req.url == " + req.url);
error 200 "Ban added";
}

if (req.request == "CACHEPURGEDIRECTORY") {
ban("req.http.host == " + regsub(req.http.host, ":6081", "") + " && req.url ~ " + req.url);
error 200 "Ban added";
}

if (req.restarts == 0) {
if (req.http.x-forwarded-for) {
set req.http.X-Forwarded-For =
req.http.X-Forwarded-For + ", " + client.ip;
} else {
set req.http.X-Forwarded-For = client.ip;
}
}

set req.backend = default;

if (req.http.host == "xxxx.com") {
set req.http.host = "www.xxxx.com";
}

if (req.url ~ "\.(jsp|action)$") {
return (pass);
}

if (req.url ~ "(.*)/(\?.*)?$") {
set req.url = regsub(req.url, "(.*)/(\?.*)?$", "\1/");
}

if (req.url ~ "\.html?.*") {
set req.url = regsub(req.url, "\.html?.*", "\.html");
}

if (req.url ~ "/index.html$") {
set req.url = regsub(req.url, "/index.html", "/");
}

if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|htm|html)$") {
remove req.http.Accept-Encoding;
unset req.http.Cookie;
unset req.http.Vary;
} elsif (req.http.Accept-Encoding ~ "gzip") {
set req.http.Accept-Encoding = "gzip";
} elsif (req.http.Accept-Encoding ~ "deflate") {
set req.http.Accept-Encoding = "deflate";
} else {
remove req.http.Accept-Encoding;
}
}


return (lookup);
}

sub vcl_pipe {
return (pipe);
}

sub vcl_pass {
return (pass);
}

sub vcl_hash {
hash_data(req.url);
if (req.http.host) {
hash_data(req.http.host);
} else {
hash_data(server.ip);
}
return (hash);
}

sub vcl_hit {
if (req.request == "xxx" || req.request == "xxx_directory") {
purge;
error 200 "Purged.";
}
return (deliver);
}

sub vcl_miss {
if (req.request == "xxx" || req.request == "xxx_directory") {
purge;
error 200 "Purged.";
}
return (fetch);
}

sub vcl_fetch {

if (req.http.host == "x.xxxx.com") {
unset beresp.http.set-cookie;
set beresp.ttl = 7d;
}

if (beresp.ttl <= 0s ||
beresp.http.Set-Cookie ||
beresp.http.Vary == "*") {
set beresp.ttl = 120 s;
return (hit_for_pass);
}

if (beresp.status == 404 || beresp.status == 503 || beresp.status == 500 || beresp.status == 502) {
set beresp.http.X-Cacheable = "NO: beresp.status";
set beresp.http.X-Cacheable-status = beresp.status;
return (hit_for_pass);
}

if (req.url ~ "\.(html|htm)$") {
set beresp.do_gzip = true;
if (req.url ~ "/list_") {
set beresp.ttl = 600s;
} else {
set beresp.ttl = 8h;
}
} else if (req.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf)$") {
set beresp.ttl = 8h;
} else {
set beresp.ttl = 8h;
}

return (deliver);
}

sub vcl_deliver {
set resp.http.x-hits = obj.hits ;
if (obj.hits > 0) {
set resp.http.X-Cache = "HIT From Server!";
} else {
set resp.http.X-Cache = "MISS Me!";
}

remove resp.http.X-Varnish;
remove resp.http.Via;
remove resp.http.Age;
remove resp.http.Server;
remove resp.http.X-Powered-By;

return (deliver);
}

sub vcl_error {
set obj.http.Content-Type = "text/html; charset=utf-8";
set obj.http.Retry-After = "5";
synthetic {"
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>"} + obj.status + " " + obj.response + {"</title>
</head>
<body>
<h1>Error "} + obj.status + " " + obj.response + {"</h1>
<p>"} + obj.response + {"</p>
<h3>Guru Meditation:</h3>
<p>XID: "} + req.xid + {"</p>
<hr>
<p>xxxx cache server</p>
</body>
</html>
"};
return (deliver);
}

sub vcl_init {
return (ok);
}

sub vcl_fini {
return (ok);
}
2014-05-14 18:55:31 +08:00
回复了 jalen 创建的主题 分享发现 昨儿撸的团购椅子到了
上点图看看
2014-05-14 14:30:25 +08:00
回复了 woaixiangbao 创建的主题 程序员 凡客域名到期了?
域名过期需要过一段时间,才能被其他的人注册
2014-05-12 13:16:09 +08:00
回复了 BackBox 创建的主题 问与答 想学习 node
@BackBox 这个没有研究过
2014-05-12 13:00:54 +08:00
回复了 BackBox 创建的主题 问与答 想学习 node
express
2014-05-09 19:08:07 +08:00
回复了 wangfeng3769 创建的主题 问与答 asp.net、php 和 python 做网站,哪个更牛逼。
适合你的才是最好的,那个都可以。
@Ever 哦,错了
ruby-china是ruby on rails + mysql
2014-05-09 10:28:06 +08:00
回复了 bosshida 创建的主题 问与答 建一个乡镇政府对外公开的信息网站,需要多少钱?
@bosshida 域名最好自己买,vps么,看你的数据的重要程度了,如果你觉得没有什么,也可以让外包提供,但是其实这些费用都是要加到里面的。
2014-05-09 08:59:32 +08:00
回复了 bosshida 创建的主题 问与答 建一个乡镇政府对外公开的信息网站,需要多少钱?
看功能需求
需求整理-->签订合同-->功能开发-->部署服务-->上线测试
1 ... 4  5  6  7  8  9  10  11  12  13 ... 20  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1433 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 32ms · UTC 23:44 · PVG 07:44 · LAX 16:44 · JFK 19:44
Developed with CodeLauncher
♥ Do have faith in what you're doing.