Welcome! Log In Create A New Profile

Advanced

Re: Nginx proxying to Apache: what about mod_rewrite?

Gabriel Ramuglia
September 30, 2009 01:28PM
I would think it would work from either. In apache, it would be in an
..htaccess file in the directory that you want the rewrite rule to
apply to.

On Wed, Sep 30, 2009 at 10:01 AM, illarra <nginx-forum@nginx.us> wrote:
> Hi!
>
> I have a website running on a Nginx + Apache configuration.
> Nginx serves the static content (in a different domain) and proxies directly to Apache, where all the PHP is executed.
>
> The problem is that my app uses mod_rewrite, and I can't find where I have to put the rules.
>
> This is a snippet of nginx.conf...
>
> server {
>    listen 0.0.0.0:80;
>    server_name domain.com;
>    location / {
>        proxy_pass http://127.0.0.1:8030;
>    }
> }
>
>
> And the Apache configuration...
>
>
> ServerName domain.com
> ServerAlias www.domain.com
> DocumentRoot /home/www
>
>    Options -Indexes IncludesNOEXEC FollowSymLinks -MultiViews
>    AllowOverride All
>    Order allow,deny
>    Allow from all
>
>
>
>
> The rewrite rule in Apache was this one, and it worked before I created the Nginx + Apache configuration.
>
> RewriteRule ^(.*)$ index.php?r=$1?%{QUERY_STRING}
>
>
> The question is, where should I put the rewrite condition? in Nginx (adapted, of course) or Apache?
>
> Thanks for having a look!
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,10271,10271#msg-10271
>
>
>
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: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready