Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
oslivan
@strfory
Member
NO. 21397 / 2015-10-04

[email protected]
0 Topics / 2 Replies
0 Followers
4 Following
2 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 记一次 Rails 项目异常排查 at January 24, 2017

    厉害,学习了。

  • 请问有人遇到在内网开发时,rails 通过反向代理运行在 nginx 后端,调用 request.remote_ip 无法获取客户端 IP 或者报错吗? at October 20, 2016

    我的部署环境是 nginx + thin + rails 4.2.6,也是通过 Nginx 反向代理后,通过 request.remote_ip 获取为 127.0.0.1,解决方法为:在 nginx.conf 中添加: proxy_set_header X-Forwarded-For $remote_addr; 在 config/application.rb 中配置: require 'ipaddr' config.action_dispatch.trusted_proxies = %w(127.0.0.1 ::1 fc00::/7 10.0.0.0/8).map { |proxy| IPAddr.new(proxy) }

关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English