Django

Code

Ticket #3833 (closed: fixed)

Opened 2 years ago

Last modified 1 year ago

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

Reported by: Nebojša Đorđević - nesh <nesh@studio-quattro.com> Assigned to: jacob
Milestone: Component: Documentation
Version: SVN Keywords: MESSAGE
Cc: Jbeil Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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.

Attachments

Change History

(follow-ups: ↓ 2 ↓ 4 ) 03/29/07 07:00:40 changed by Simon G. <dev@simon.net.nz>

  • cc changed from nesh@studio-quattro.com to nesh@studio-quattro.com, dev@simon.net.nz.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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 ) 03/29/07 07:14:23 changed by Nebojša Đorđević - nesh <nesh@studio-quattro.com>

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.

04/18/07 05:16:43 changed by SmileyChris

  • summary changed from FastCGI apache setup should have Pass Through added for the media files to FastCGI apache setup should mention using Pass Through in case of a proxied media server.
  • stage changed from Unreviewed to Design 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 ) 06/02/07 10:14:18 changed by Ben Jones <django@superutility.net>

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.

06/02/07 17:46:08 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Design decision needed to Accepted.

06/07/07 13:01:17 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

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

08/14/07 13:44:31 changed by EMUNNYUNLIP

  • cc changed from nesh@studio-quattro.com, dev@simon.net.nz to Jbeil.
  • keywords set to MESSAGE.

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

08/14/07 13:45:58 changed by EMUNNYUNLIP

Everybody likes sex! A lot of local girls need sex right <a href=http://adultfriendfinderpersonalsfreeonli.blogspot.com/>here</a> http://adultfriendfinderpersonalsfreeonli.blogspot.com/


Add/Change #3833 (FastCGI apache setup should mention using Pass Through in case of a proxied media server)




Change Properties
Action