[LRUG] Rails, SSL, nginx, Downloads and Internet Explorer

mudge mudge at mudge.name
Thu Mar 22 05:07:43 PDT 2012


One thing that might be worth investigating is the fact that nginx's
default for the "expires" directive ("off") prevents changes to the
"Expires" and "Cache-Control" headers (c.f.
http://wiki.nginx.org/HttpHeadersModule#expires).

On Thu, Mar 22, 2012 at 11:50 AM, Rory Franklin <rory at chillibean.tv> wrote:
> Hi LRUG,
>
> We are serving up large file downloads from a rails 3.0 application using
> nginx via an X-Accel-Redirect header. This worked splendidly up until
> recently when we switched over to serving the application and downloads over
> HTTPS.
>
> Apparently Internet Explorer doesn't like downloading files over SSL when
> the Cache-Control header is set to "no-cache" as it can't handle it
> internally.
>
> Unfortunately, we can't figure out how to set the Cache-Control header as
> everything we've tried doesn't change it from "no-cache".
>
> We've tried the proxy_hide_header Cache-Control; declaration in nginx. We've
> tried using add_header Cache-Control "private"; in nginx too, without any
> luck. In the rails application we are serving the file as follows:
>
> head(:x_accel_redirect =>
> "/file_redirect/#{INTERNAL_MEDIA_HOST}/#{filepath}", :content_type => mime,
> :content_length => size, :content_disposition => "attachment;
> filename=\"filename.mp4"")
>
> So before that we've tried adding:
>
> response.headers.delete("Pragma")
> response.headers.delete('Cache-Control')
>
> and also
>
> response.headers["Cache-Control"] = "public"
> response.headers["Pragma"] = ""
> response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
>
> In the case of the last one, the Expires header does get set, but
> Cache-Control stays as "no-cache".
>
> Does anyone have any suggestions as to what might be causing this and how we
> could set our own Cache-Control header?
>
>
>
> Thanks,
> Rory
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>



More information about the Chat mailing list