Forward requests for one domain to another without changing URL.

Igor Sysoev is at rambler-co.ru
Sat Aug 1 20:49:09 MSD 2009


On Sat, Aug 01, 2009 at 09:20:21AM +0000, Richard Cooper wrote:

> I can't seem to find enough information about the proxy or rewrite modules for
> nginx to try and work this out myself, but what I'm trying to do is have the 
> pages served at one domain available at another domain on a slightly different
> path.
> 
> If it helps I'm running Django under FASTCGI behind nginx behind Apache for 
> my-stuff.com and I need to add rules for my-books.com such that:-
> 
> http://my-books.com/book1/ serves the page at http://my-stuff.com/books/book1/
> http://my-books.com/book2/ serves the page at http://my-stuff.com/books/book2/
> ... etc.
> 
> The important thing is not to re-direct as I want pages available at _both_ urls.

Could you show a request path ? For example, as

         my-books.com/book1/ > my-stuff.com/books/book1/

nginx can proxy

        location / {
           proxy_pass  http://backend/book/;
        }

or

        location /book/ {
           proxy_pass  http://backend/;
        }

BTW, why do you run nginx behind Apache ? nginx has been designed to run
before Apache.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list