English 中文(简体)
1. 在反向代理安排中使用错误的停靠港的总括安排
原标题:OmniAuth using wrong callback port in a reverse proxy setup
最佳回答

我对总括Auth的资料来源进行了研究,发现反馈机制内部使用一种名为<条码>full_host<>>>的方法来研究组合变量,然后建立世界投资倡议的第一部分。

组合变量可以是强硬(如你的情况),也可以是建议,也可以是零(或任何其他情况)。 在后一种情况下,URI的要求是平价的、cho合的和退还的。

I think that we can t solve our common problem by just setting an environment variable in Apache (this probably should be done at a lower level, inside the ruby application stack), but after some experimentation I ve found this works well enough for me:

OmniAuth.config.full_host = lambda do |env|
    scheme         = env[ rack.url_scheme ]
    local_host     = env[ HTTP_HOST ]
    forwarded_host = env[ HTTP_X_FORWARDED_HOST ]
    forwarded_host.blank? ? "#{scheme}://#{local_host}" : "#{scheme}://#{forwarded_host}"
end
问题回答

我也有同样的问题。 解决办法是通过设定

**proxy_set_header        Host            <proxy-domain-name>;**



  location / {
  proxy_pass  http://127.0.0.1:3000;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;
        proxy_buffering off;
        proxy_set_header        Host            <domain name>;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
 }

Regarding facebook redirect issue, I spent some time investigating the value of the actual url it was redirecting the callback to, so I had to fix that in nginx conf. For finding that out, look at the url in the link and see the value of "redirect_uri" GET variable value instead of focusing on the error it sent on the main page.





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签