Ruby on Rails Saturday, January 1, 2011

Hi,
I'm sending a simple Ajax HTTP POST with username/password to Rails. It
lands in SessionsController, which requires SSL on 'create' action using
ssl_requirement plug-in. However, Rails can't render and browser(Chrome)
says "Failed to load resource" while the following log is dumped at
production log:

Processing SessionsController#create [POST]
Parameters: {"action"=>"create", "controller"=>"sessions",
"login"=>"my_user", "password"=>"[FILTERED]"}
Redirected to https://mysite.com/sessions
Filter chain halted as [:ensure_proper_protocol] rendered_or_redirected.
Completed in 3ms (DB: 1) | 302 Found [http://mysite.com/sessions]

Is it trying to render's Sessions Controller's view?? I don't have a
view for it, SessionController:create should authenticate the user and
render back an ACK to the Javascript client.

Below is my HTTPS server block at nginx:
server {
listen 443;
server_name www.mysite.com;
proxy_set_header X_FORWARDED_PROTO https;
ssl on;
ssl_certificate /srv/ssl/mysite.com.combined.crt;
ssl_certificate_key /srv/ssl/mysite.com.key;
keepalive_timeout 70;
}

I could not figure out if the problem is with NGINX - SSL setup or
Rails-SSL_requirement issue. Any ideas? I have Rails 2.3.8,
ssl_requirement plug-in and passenger 3.02 + nginx 0.8.53.

Thanks in advance.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment