Password protecting Rails site running on Nginx and Phusion Passenger Password protecting Rails site running on Nginx and Phusion Passenger nginx nginx

Password protecting Rails site running on Nginx and Phusion Passenger


You need to re-specify passenger_enabled in the location block.


You can let Rails handle the authentication

# application_controller.rbbefore_filter :authenticateprotecteddef authenticate  authenticate_or_request_with_http_basic do |username, password|    username == "foo" && password == "bar"  endend

also you should set config.serve_static_assets = true in your environment.rb (or applicaion.rb in Rails 3) so that the static assets in public go through the same filter.


Check your Nginx error log. 403 means that you got the path to your password file wrong.