开发者

Rails authenticate_or_request_with_http_basic not working on SSL + Nginx

I've get an action in my Rails 3 app that I'm pw-protecting with authenticate_or_request_with_http_basic. Working fine on my development machine but it's not prompting for the http_basi开发者_如何学运维c user/password on the production server.

The entire production app runs over https/SSL on nginx.

Where do I look to resolve this? Does http basic auth not work over SSL? Or is there an nginx setting I need to look at?

TIA


Not sure if this related to Rails 3.

I just recently had problems running Mongrel 1.1.5 and Rails 2.3.8

Apparently, there is a bug in this set up where our production machine does not prompt for the user name and password (but works locally, because we are using web-brick).

In the mongrel.log we keep getting this error:

Error calling Dispatcher.dispatch #split' called for nil :NilClass> /usr/local/rvm/gems/ruby-1.8.7-p174/gems/actionpack-2.3.8/lib/action_controller/cgi_process.rb:52:indispatch_cgi' /usr/local/rvm/gems/ruby-1.8.7-p174/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi' ...

Found the monkey patch needed to fix this Mongrel 1.1.5 and Rails 2.3.8 and it worked for me. The german site that lead to the solution: http://railssprech.de/ with 2 links for 2.3.8 and 2.3.9.

Here is the 2.3.8 version: http://www.pcoder.net/error-calling-dispatcher-dispatch/#axzz1RknBQso2

The patch explains why this error was occurring. Check the Rails 3 CGIHandler.dispatch_cgi method and see if it the same bug. You may need to extract the Rails 3 out and monkey patch it.

Hope this helps.

BTW: Mongrel 1.1.5 and Rails 2.3.5 works!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜