Rails 3, Authlogic, NGINX, and basic HTTP authentication do not work well together

I am in the early stages of building an application using Rails 3. User authentication works from Authlogic, which I set pretty much as standard ( according to the docs example ), and everything works as expected locally.

I just deployed a Centos 5.4 / NginX / Passenger server clean installation application so that employees can start logging in and entering content, etc. However, we are far from being prepared for the public eye. I used the basic NginX auth module to keep the entire site at a different authentication level.

Unfortunately, authentication-based authentication and NginX basic authentication seem to contradict each other. If basic auth is enabled, then it is not possible to log in with Authlogic, but if I disable basic auth, then Authlogic will work as expected.

I have not posted any code since I am really not sure which code will matter. I wonder if this is a known issue, and are there any changes I can make to the configuration to get around this?

+5
source share
2 answers

( ). Authlogic::Session::Config .

class UserSession < Authlogic::Session::Base
  allow_http_basic_auth false
end
+13

Rails 3, . auth NginX.

  • , .
  • , VPN.
  • ip ssh , . socks proxy ssh ( linux: ssh -D 8080 user@yourserver.com, 8080 - , - socks , yoursever.com:3000).
  • , NginX IP- , .
  • ApplicationController before_filter :require_login:), .

, !

+1

All Articles