Shelby.tv/blog

  • Archive
  • RSS
'\x3ciframe width=\x22500\x22 height=\x22375\x22 src=\x22http://www.youtube.com/embed/gv_biM6U3ls?wmode=transparent\x26autohide=1\x26egm=0\x26hd=1\x26iv_load_policy=3\x26modestbranding=1\x26rel=0\x26showinfo=0\x26showsearch=0\x22 frameborder=\x220\x22 allowfullscreen\x3e\x3c/iframe\x3e'

Digital Lab Blog:

Craig Heimbach, Senior Editor from Barefoot Proximity, interviews Dan Spinosa, co-founder and CEO of Shelby.TV, a startup focused on delivering a next generation, personalized TV experience.

Mr. Spinosa reveals the dynamics behind the new “me TV” movement and explains how Shelby.TV can help brands take advantage of this new trend.

You’ve been waiting! Here’s the 1st video of our #SXSW goats.

    • #projectGOATS
    • #goats
    • #bbdo
    • #proximity digital
    • #shelby.tv
    • #dan spinosa
  • 1 year ago
  • 1
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Getting Rails SSL right on Nginx w/ Passenger

danspinosa:

400 Bad Request

The plain HTTP request was sent to HTTPS port

It bugged me for an entire day.  ”Please send HTTPS stuff to HTTPS and I’ll be perfectly happy,” said nginx.  ”Fuck you, I do what I want,” said the oAuth callback from Twitter.  So I started digging…

Maybe I could just tell nginx to re-direct the request.  It knows what it wants; it should be able to satisfy itself…

error_page 497 https://$host$request_uri;

Nope.  But if this did work, it would only treat a symptom, not the problem itself.

So I needed to find out *why* the oAuth callback_url was being set to “http://shelby.tv:443” instead of “https://shelby.tv”.  A little digging into OmniAuth and I found the full_host method which ultimately makes this determination based on request.url.  An additional line of logging and I discovered that reqeust.url had the http scheme, not https.

I’m running Rails w/ Passenger on nginx.  But nginx likes to keeps secrets from Rails (specifically, it doesn’t let on about SSL).  So you just ask nginx to let Rails in on the secret and boom, everything “just works” (thanks to the excellent work on the Rails core team and OmniAuth, behind the scenes).

passenger_set_cgi_param HTTP_X_FORWARDED_PROTO https;

That’s it.  Threw that one liner into my ssl-enabled server{} block and Rails’ request.url was fixed, allowing OmniAuth correctly built the callback_url.  :-]

—-

FYI: I spent almost a full day researching this problem (to no avail), during which time I learned a shit tonne about these technologies and code bases.  I then made a smart move: document my progress and go home.  Came in the next morning and hit the fix in 20 minutes.  

Work is a much better version of school.

    • #dan spinosa
  • 1 year ago > danspinosa
  • 37
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Who are these dashing, brilliant young men? Find out HERE!
View Separately

Who are these dashing, brilliant young men? Find out HERE!

    • #dan spinosa
    • #reece pacheco
    • #mashable
  • 1 year ago
  • 6
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

About

Shelby TV is your hub for the videos that matter to you, your friends, and the world around you.

Watch videos you'll love on Shelby TV!

Pages

  • Work with Shelby. Build the future of TV.
  • Hiring: Designer

Top

  • RSS
  • Random
  • Archive
  • Mobile
Effector Theme by Pixel Union