Welcome! Log In Create A New Profile

Advanced

Re: Nginx proxying to Apache: what about mod_rewrite?

Jeff Waugh
September 30, 2009 01:38PM
<quote who="illarra">

> RewriteRule ^(.*)$ index.php?r=$1?%{QUERY_STRING}
>
> The question is, where should I put the rewrite condition? in Nginx
> (adapted, of course) or Apache?

You could do either, but you may as well do it in nginx and save Apache the
effort. As a bonus, you can get nginx to serve static files before it passes
the rewritten request to Apache:

try_files $uri $uri/ /index.php?r=$request_uri;

Two birds. One stone. :-)

- Jeff

--
linux.conf.au 2010: Wellington, NZ http://www.lca2010.org.nz/

"Maybe you should put some shorts on or something, if you want to keep
fighting evil today." - The Bowler, Mystery Men
Subject Author Posted

Nginx proxying to Apache: what about mod_rewrite?

illarra September 30, 2009 01:01PM

Re: Nginx proxying to Apache: what about mod_rewrite?

Gabriel Ramuglia September 30, 2009 01:28PM

Re: Nginx proxying to Apache: what about mod_rewrite?

hdanniel September 30, 2009 01:28PM

Re: Nginx proxying to Apache: what about mod_rewrite?

illarra September 30, 2009 02:01PM

Re: Nginx proxying to Apache: what about mod_rewrite?

illarra September 30, 2009 02:16PM

Re: Nginx proxying to Apache: what about mod_rewrite?

hdanniel September 30, 2009 03:14PM

Re: Nginx proxying to Apache: what about mod_rewrite?

illarra September 30, 2009 04:24PM

Re: Nginx proxying to Apache: what about mod_rewrite?

illarra October 01, 2009 04:25AM

Re: Nginx proxying to Apache: what about mod_rewrite?

tycjan October 22, 2010 11:41AM

Re: Nginx proxying to Apache: what about mod_rewrite?

Jeff Waugh September 30, 2009 01:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 196
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready