Re: [users@httpd] mod_rewrite - Reverse Proxying CGIs with PATH_INFO to a Backend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 07, 2005 at 08:05:11AM +0100, Nick Kew wrote:
> Keith Bare wrote:
> 
> > RewriteRule /(.*\.cgi)$ http://cgi-backend/$1 [P]
> > 
> > but this fails for CGI scripts that use PATH_INFO.
> 
> Of course it does.  The $ means it matches only at the
> end of a URL.  If the string ".cgi" is sufficient to identify
> the URL as CGI, then just add another .* before closing your
> brackets.

An issue with that, is it will also proxy requests for static pages
that have names containing ".cgi" to the backend.  This is okay with
the current setup I'm using, but if I configure the backend so it
won't serve any static pages, these pages would become inaccessible.
Another issue is that, perhaps some user might write a buggy CGI that
would take down the backend.  I wouldn't want any static pages to
become inaccessible if this were to happen.  I agree that static pages
should not contain a ".cgi" in their name, but I don't have control
over what my users do.

It seems like there SHOULD be some way to use a subrequest to
determine if a CGI would be executed.  Is there some crafty way to use
%{LA-U:...} or %{LA-F:...} to do this?  Or by having apache do
something special whenever it tries to execute a CGI that mod_rewrite
can catch?  I wouldn't think I'm the only person trying to do
something like this.

-Keith Bare

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux