Skip to content

Instantly share code, notes, and snippets.

View djbrowning's full-sized avatar

Dave Browning djbrowning

  • Apple
  • California
View GitHub Profile
@brobertsaz
brobertsaz / serversetup.md
Last active July 6, 2020 08:56
Ubuntu 12.04 Ruby, Rails, Nginx, Unicorn

Ubuntu 12.04, Ruby, Rails, Nginx, Unicorn and git-deploy

In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.

Server Setup

  • Create new server
  • Login to new server
    • ssh root@IPaddress (you can also use the domain name if you have the DNS setup already)
    • accept the RSA key
@lfborjas
lfborjas / proxy.ru
Created September 10, 2011 03:54
Simple proxy server for developing front-ends for APIs (using rack middleware)
require 'rack'
require 'rack/proxy' #gem install rack-proxy
class Proxy < Rack::Proxy
def rewrite_env(env)
env["HTTP_HOST"] = "my.host.com"
env["SERVER_PORT"] = "80"
env
end
end