Search code examples
facebookruby-on-rails-3facebook-graph-apioauthunicorn

oauth not firing auth/facebook on production


I have built a rails app with both facebook and twitter integration, everything was working fine on development but after moving to production (I have changed the url on fb and twitter settings to my site url subdomain.domain.com) oauth is not triggering only. It is pointing to unicorn corn file name and giving invalid URI error. I have pasted the error below. Any help is highly appreciated...

URI::InvalidURIError (the scheme http does not accept registry part: unicorn_txt_browser (or bad hostname?)):
  /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/uri/generic.rb:213:in `initialize'
  /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/uri/http.rb:84:in `initialize'
  /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/uri/common.rb:214:in `new'
  /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/uri/common.rb:214:in `parse'
  /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/uri/common.rb:747:in `parse'
  omniauth (1.1.1) lib/omniauth/strategy.rb:404:in `full_host'
  omniauth-oauth2 (1.0.3) lib/omniauth/strategies/oauth2.rb:34:in `callback_url'
  omniauth-facebook (1.4.0) lib/omniauth/strategies/facebook.rb:106:in `callback_url'
  omniauth-oauth2 (1.0.3) lib/omniauth/strategies/oauth2.rb:46:in `request_phase'
  omniauth-facebook (1.4.0) lib/omniauth/strategies/facebook.rb:94:in `request_phase'
  omniauth (1.1.1) lib/omniauth/strategy.rb:207:in `request_call'
  omniauth (1.1.1) lib/omniauth/strategy.rb:174:in `call!'
  omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
  omniauth (1.1.1) lib/omniauth/builder.rb:48:in `call'
  actionpack (3.2.5) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.1) lib/rack/etag.rb:23:in `call'
  rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.2.5) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.5) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.5) lib/action_dispatch/middleware/flash.rb:238:in `call'

Solution

  • I got the issue, in my nginx conf file, the proxy pass was "unicorn_txt_browser" where underscore is not allowed, changing it to "unicorn-txt-browser" fixed the issue....