Welcome! Log In Create A New Profile

Advanced

Re: rewrite n00b

May 13, 2011 11:04AM
Awesome thanks :)

I've got this, to redirect the requests, but If I request a file from
the orginal host, it won't redirect to the same file on the ip.

rewrite ^ http://113.214.191.192 permanent;

So http://domain.com/files.txt -> redirects to
http://113.214.191.192/files.txt (without the need to specifiy each
file name)

Thanks for the help



On Thu, May 12, 2011 at 5:20 PM, Igor Sysoev <igor@sysoev.ru> wrote:
> 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
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

rewrite n00b

fanboy May 11, 2011 10:14PM

Re: rewrite n00b

Igor Sysoev May 12, 2011 01:22AM

Re: rewrite n00b

fanboy May 13, 2011 11:04AM

Re: rewrite n00b

Igor Sysoev May 13, 2011 02:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 199
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