[nginx+Thin]バックエンドをhttpsでリバースプロキシ

nginxでbackendのwebサーバを動かすときはリバースプロキシを使います。
httpsサイトではbackendにリバースプロキシするとhttpになってしまいます。
backend側に、

  1. リバースプロキシされていること
  2. https通信であること

Rack::Session::Cookieの使い方

ソースコード抜粋

# Rack::Session::Cookie provides simple cookie based session management.
# By default, the session is a Ruby Hash stored as base64 encoded marshalled
# data set to :key (default: rack.session).  The object that encodes the
# session data is configurable and must respond to +encode+ and +decode+.
# Both methods must take a string and return a string.
#
# When the secret key is set, cookie data is checked for data integrity.
# The old secret key is also accepted and allows graceful secret rotation.
#
# Example:
#
#     use Rack::Session::Cookie, :key => 'rack.session',
#                                :domain => 'foo.com',
#                                :path => '/',
#                                :expire_after => 2592000,
#                                :secret => 'change_me',
#                                :old_secret => 'also_change_me'
#
#     All parameters are optional.
#
# Example of a cookie with no encoding:
#
#   Rack::Session::Cookie.new(application, {
#     :coder => Rack::Session::Cookie::Identity.new
#   })
#
# Example of a cookie with custom encoding:
#
#   Rack::Session::Cookie.new(application, {
#     :coder => Class.new {
#       def encode(str); str.reverse; end
#       def decode(str); str.reverse; end
#     }.new
#   })
#

Ruby1.9.3+SQLite3+Sinatraでエラーを拾えない問題

Ruby1.9.3でSinatraを使った時にエラーハンドラーで例外の詳細を拾えない問題に遭遇しました。

状況

[AngularJS]Tutorial: 4 - Two-way Data Bindingをやってみる

気になったRubyのメソッド

instance_eval

ブロックの中のselfが呼び出し元オブジェクトになるってことかしら