V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  rails3  ›  全部回复第 11 页 / 共 20 页
回复总数  396
1 ... 3  4  5  6  7  8  9  10  11  12 ... 20  
2014-07-17 16:08:57 +08:00
回复了 2code 创建的主题 问与答 请大家推荐个短信平台
@victor 状态报告和上行都有的。
2014-07-17 15:35:07 +08:00
回复了 2code 创建的主题 问与答 请大家推荐个短信平台
@lygmqkl @2code

我朋友他们公司就是专门做短信平台的,现在很多银行,电商,证券等都是他们公司的客户,就像上面说的京东就是,他们公司是移动数据企业中中前三名。你可以联系下我朋友 Q 86 302 388
2014-07-17 15:29:07 +08:00
回复了 2code 创建的主题 问与答 请大家推荐个短信平台
@lygmqkl @2code 可以联系我,qq: 8 6302 38 8
2014-07-17 15:28:31 +08:00
回复了 2code 创建的主题 问与答 请大家推荐个短信平台
可以联系我,qq: 8 6302 38 8
阿根廷 1:1 德国
2014-07-09 16:36:08 +08:00
回复了 fx 创建的主题 程序员 Sublime text 抽奖活动
2014-07-04 09:08:15 +08:00
回复了 yangzh 创建的主题 程序员 想做一个新网站,用什么语言框架和设计?各种建议?
@panlilu 铁轨上切红宝石好啊
cas server
来晚了啊
@yanerweb

public class TestController {

private ITestService testService;

get method;

set method;
}


TestServiceA, TestServiceB, TestServiceC 实现ITestService接口,testService属于三个实现类中的那个,由spring配置决定,这就是spring ioc
7个模块可能都会用到。
2014-06-27 11:01:44 +08:00
回复了 ykennyy 创建的主题 程序员 请教要如何实现类似新浪微博的网页私信推送功能
长连接
socket.io
跟投了。
2014-05-30 17:25:55 +08:00
回复了 solar 创建的主题 Varnish 求助:关于 varnish 配置的问题
2014-05-30 17:19:47 +08:00
回复了 solar 创建的主题 Varnish 求助:关于 varnish 配置的问题
@solar 没有问题,我用你的配置测试了
2014-05-30 16:39:16 +08:00
回复了 solar 创建的主题 Varnish 求助:关于 varnish 配置的问题
我们这边是 nginx --> varnish --> nginx
你也可以 varnish --> nginx

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);
}
1 ... 3  4  5  6  7  8  9  10  11  12 ... 20  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5548 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 33ms · UTC 02:15 · PVG 10:15 · LAX 18:15 · JFK 21:15
Developed with CodeLauncher
♥ Do have faith in what you're doing.