我的服务器没有公共IP地址,所以我不知道如何获取真实客户端的IP地址.
这是我的nginx的配置:
location / {
proxy_pass http://domain1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Run Code Online (Sandbox Code Playgroud)
在我的Rails应用程序的控制器中,request.ip
并request.remote_ip
返回我的服务器的网关地址.
我怎样才能获得客户的真实IP?
如何从Rails请求中获取X-Forwarded-For值?
我使用rails3-jquery-autocomplete插件,我只是想知道如何使用它来执行多个单词自动完成.
例如INPUT rails,gem它应该生成两次自动列表.
如何解决这个问题呢?..
我想将rails插件设计 'reset_password_instructions设置为delayed_job ..但我尝试了很多方法并且失败了.
我找到了一个函数password_controller#creat:
self.resource = resource_class.send_reset_password_instructions(params[resource_name])
Run Code Online (Sandbox Code Playgroud)
我认为用于发送电子邮件重置密码的句子.
我想改变它:
self.resource = Delayed::Job.enqueue ApplicationController::MailingJob.new(:resource_class.send_reset_password_instructions, params[resource_name])
Run Code Online (Sandbox Code Playgroud)
好的,它会返回语法错误...
帮助我..我不知道如何解决它.. thx.
delayed-job ×1
devise ×1
ip-address ×1
jquery ×1
jquery-ui ×1
networking ×1
nginx ×1
ruby ×1
web-services ×1