Skip to content

Instantly share code, notes, and snippets.

@nowk
Last active December 12, 2015 03:18
Show Gist options
  • Save nowk/4705405 to your computer and use it in GitHub Desktop.
Save nowk/4705405 to your computer and use it in GitHub Desktop.
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = true
config.middleware.insert_after(::Rack::Lock, "::Rack::Auth::Basic", "Staging") do |u, p|
[u, p] == [ENV['BASIC_AUTH_USER'], ENV['BASIC_AUTH_PASSWORD']]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment