rewrite n00b

Igor Sysoev igor at sysoev.ru
Thu May 12 09:20:53 MSD 2011


On Thu, May 12, 2011 at 02:13:03PM +1200, Ryan B wrote:
> Hi,
> Just wanting to enabled a rewrite of the following url,
> 
> Redirecting all requests from http://www.domain.com/site/forums and
> http://www.domain.com/forums to http://forums.domain.com

server {
    server_name  www.domain.com;

    location /forums {
        rewrite  ^/forums(.*)$  http://forums.domain.com$1;
    }

    location /site/forums {
        rewrite  ^/site/forums(.*)$  http://forums.domain.com$1;
    }

    ...


-- 
Igor Sysoev



More information about the nginx mailing list