httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] Different ProxyPass protocols within a VirtualHost for certain files
Date Fri, 12 Dec 2003 16:22:01 GMT
On Fri, 12 Dec 2003, Fabio Corazza wrote:
> > RewriteEngine On
> > RewriteCond %{REQUEST_URI} !.*\.pdf$
> > RewriteRule ^/.* https://www.site.com/$1 [P]
> > RewriteCond %{REQUEST_URI} .*\.pdf$
> > RewriteRule ^/.* http://www.site.com/$1 [P]

> Just to be sure I'm not misunderstanding the syntax of your directives
> at all, let me resume: you don't rewrite the URI if the file is not a
> PDF while if it is you rewrite it in HTTP. The [P] flag means to act as
> a proxy just like mod_proxy does.

It says "If the URL doesn't end in .pdf, proxy using https, if it does end
in .pdf, proxy using http.  The P flag does indeed imply a reverse proxy.
It requires mod_proxy to be present, however.

>
> > Unfortunately, you can only use a single ProxyPassReverse.  You'll
> > probably want to use the https version, since it is unlikely that pdfs
> > will generate a redirect that requires rewriteing.
>
> Do you mean that, within a VirtualHost instance, I can use only a
> RewriteRule directive marked with [P] flag? If I guess right, I'll for
> sure use the https one. I'll give a try, nothing wrong with a graceful
> restart.

No, you can use any number of RewriteRules.  You can only use a single
ProxyPassReverse.  The RewriteRules (or ProxyPass) do the actual reverse
proxy.  The ProxyPassReverse is necessary to get apache to rewrite urls
that are sent back to the client in the http headers.  If this rewrite
does not happen, redirects sent by the backend server will jump out of the
proxy.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message