Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#3833 closed (fixed)

FastCGI apache setup should mention using Pass Through in case of a proxied media server

Reported by: Nebojša Đorđević - nesh <nesh@…> Owned by: Jacob
Component: Documentation Version: dev
Severity: Keywords: MESSAGE
Cc: Jbeil Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the FastCGI documentation says that media rewrite rule should look like this:

RewriteRule ^/(media.*)$ /$1 [QSA,L]

but I found-out (and someone in the comments on that page also mentions this) that you must have rewrite rule like this:

RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]

Note ,PT at the end.

Change History (8)

comment:1 by Simon G. <dev@…>, 18 years ago

Cc: dev@… added

I'm not sure why you would need the pass through flag - what's it doing in this case? I'm no mod_rewrite ninja, but AFAIK PT is usually only used when you want to hand off processing to something like Alias or Redirect. In this case, I think you're just over-riding the L (Last) flag (which is a break condition and exits immediately once this is matched)

in reply to:  1 comment:2 by Nebojša Đorđević - nesh <nesh@…>, 18 years ago

Replying to Simon G. <dev@simon.net.nz>:

I'm not sure why you would need the pass through flag - what's it doing in this case? I'm no mod_rewrite ninja, but AFAIK PT is usually only used when you want to hand off processing to something like Alias or Redirect. In this case, I think you're just over-riding the L (Last) flag (which is a break condition and exits immediately once this is matched)

I'm also far from competent in the apache rewrite stuff, but, when I tried to use configuration from docs apache did not serve media files. After searching through the comments I found this and that worked for me. Maybe this is somewhat related to my current setup (this vhost is located behind another apache which is proxying requests).

After some server changes I (again) used setup from the documentation and (again) I hit the same problem, so I figured that it will be nice to add this to the docs, maybe as a sidenote.

comment:3 by Chris Beaven, 18 years ago

Summary: FastCGI apache setup should have Pass Through added for the media filesFastCGI apache setup should mention using Pass Through in case of a proxied media server
Triage Stage: UnreviewedDesign decision needed

Perhaps as a side note, but it's not the norm case (a second apache proxying requests). Or perhaps this is getting a bit outside of Django's documentation.

in reply to:  1 comment:4 by Ben Jones <django@…>, 18 years ago

Replying to Simon G. <dev@simon.net.nz>:

I'm not sure why you would need the pass through flag - what's it doing in this case?

According to the mod_rewrite docs: "You must use this flag if you want to mix directives from different modules which allow URL-to-filename translators. The typical example is the use of mod_alias and mod_rewrite."

Since the example setup given in the Django docs uses both mod_alias and mod_rewrite to translate the media URL to the correct directory, the PT flag would be needed in this case. As such, it seems like it would be a good idea to include the flag in the example. It simply won't work otherwise.

comment:5 by Simon G. <dev@…>, 18 years ago

Triage Stage: Design decision neededAccepted

comment:6 by Jacob, 18 years ago

Resolution: fixed
Status: newclosed

(In [5433]) Fixed #3833 - added "PT" flag to mod_rewrite/fcgi example in documentation. Thanks, Nesh.

comment:7 by EMUNNYUNLIP, 17 years ago

Cc: Jbeil added; nesh@… dev@… removed
Keywords: MESSAGE added

Everybody likes sex!
If you need to find beautiful local girl, click <a href=http://adultfriendfinderpersonalsfreeonli.blogspot.com/>here</a>
http://adultfriendfinderpersonalsfreeonli.blogspot.com/

comment:8 by EMUNNYUNLIP, 17 years ago

Note: See TracTickets for help on using tickets.
Back to Top