【问题标题】:Nginx cache, redis_passNginx 缓存,redis_pass
【发布时间】:2016-04-11 20:37:24
【问题描述】:

我整天都在用头撞墙。

我正在使用下面的 nginx 配置来测试一些东西

location  /help {
  set $redis_key "cache:$scheme://$host$request_uri";
  default_type   text/html;
  redis_pass 127.0.0.1:6379;
  error_page 404 = @upstream;

}

在我的 redis 实例中有一个用于缓存的键和值:$scheme....(在我的情况下是缓存:http://localhost/help

我知道它们存在,因为我可以监视 redis-cli 的 nginx redis 请求,复制 "get" "cache:http://localhost/help",将其粘贴到另一个 redis-cli 窗口并获得预期的响应。

问题来自 nginx,它没有得到响应。我再次可以看到它从redis-cli -> monitor 内部连接,并且我知道键和值存在。

从 nginx 错误日志我可以看到这个

2016/04/08 16:52:42 [notice] 9304#0: worker process 6328 exited with  code 0
2016/04/08 16:52:42 [notice] 9304#0: signal 29 (SIGIO) received
terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::append
2016/04/08 16:52:49 [notice] 9304#0: signal 17 (SIGCHLD) received
2016/04/08 16:52:49 [alert] 9304#0: worker process 7328 exited on signal 6 (core dumped)
2016/04/08 16:52:49 [notice] 9304#0: start worker process 7516
2016/04/08 16:52:49 [notice] 9304#0: signal 29 (SIGIO) received
terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::append
2016/04/08 16:52:50 [notice] 9304#0: signal 17 (SIGCHLD) received
2016/04/08 16:52:50 [alert] 9304#0: worker process 7335 exited on signal 6 (core dumped)
2016/04/08 16:52:50 [notice] 9304#0: start worker process 7544
2016/04/08 16:52:50 [notice] 9304#0: signal 29 (SIGIO) received
terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::append

这是否与其他人有关,或者有人可以将我踢向正确的方向吗?

提前致谢

【问题讨论】:

    标签: nginx redis


    【解决方案1】:

    供以后阅读本文的任何人使用。

    首先,过去的你好!

    其次,原来nginx pagespeed模块和这种缓存是不兼容的。

    【讨论】:

    • 你的意思是我们不能用redis做缓存??
    猜你喜欢
    • 2017-07-24
    • 2012-10-25
    • 2017-03-07
    • 1970-01-01
    • 2021-01-30
    • 1970-01-01
    • 2016-09-16
    • 2017-09-08
    • 2012-07-01
    相关资源
    最近更新 更多