Opened 10 years ago

Closed 10 years ago

Last modified 9 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: master
Severity: Keywords: MESSAGE
Cc: Jbeil Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 10 years ago by Simon G. <dev@…>

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)

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

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 Changed 10 years ago by Chris Beaven

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.

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

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 Changed 10 years ago by Simon G. <dev@…>

Triage Stage: Design decision neededAccepted

comment:6 Changed 10 years ago by Jacob

Resolution: fixed
Status: newclosed

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

comment:7 Changed 9 years ago by EMUNNYUNLIP

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 Changed 9 years ago by EMUNNYUNLIP

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