Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

polymorphic_url does not take https into consideration when generating the URL

#5092

I'm running a Rails 2.3.5 application (redmine).. and It is accessible only via https as configured in my nginx.

The problem is that some plugins use polymorphic_url helper to dynamically generate full URLs for relevant ajax requests. This lead to the Ajax always failing with 302 (redirect from http to https by nginx)

An alternative is to use polymorphic_path. and I'll do that for now.

But the point is, if I open browsing my web application through https, polymorphic_url should grab the protocol from the request (like it did with the domain). That's logical but is not currently the way it works.

Thanks

Reported by modsaid · July 12th, 2010 @ 10:44 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Marjan Krekoten'
    Marjan Krekoten'

    Well this is not Rails issue. You should tell nginx to set X-Forwarded-For header so Rails will know that https is being used.

    location / {
      # ...
      proxy_set_header  X-Forwarded-For https
      # ...
    }
    

    September 16th, 2010 @ 02:08 PM

  2. David Trasbo
    David Trasbo
    • State changed from new to invalid
    • Importance changed from to Low

    Marking this invalid for now. Please try what Marjan describes. If it turns out to be a Rails issue I'll re-open.

    September 25th, 2010 @ 06:50 PM

  3. modsaid
    modsaid

    Thank you Marjan

    I'll try it

    September 26th, 2010 @ 08:29 AM