#3833 closed (fixed)
FastCGI apache setup should mention using Pass Through in case of a proxied media server
Reported by: | 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)
follow-ups: 2 4 comment:1 by , 18 years ago
Cc: | added |
---|
comment:2 by , 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 , 18 years ago
Summary: | FastCGI apache setup should have Pass Through added for the media files → FastCGI apache setup should mention using Pass Through in case of a proxied media server |
---|---|
Triage Stage: | Unreviewed → 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.
comment:4 by , 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 , 18 years ago
Triage Stage: | Design decision needed → Accepted |
---|
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 17 years ago
Cc: | added; 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 , 17 years ago
Everybody likes sex!
A lot of local girls need sex right <a href=http://adultfriendfinderpersonalsfreeonli.blogspot.com/>here</a>
http://adultfriendfinderpersonalsfreeonli.blogspot.com/
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)