Nginx redirect to an external URL

Viewed 8604

What I'm trying to do is route all requests to /rdr/extern_url to redirect to extern_url through my web server instead of doing it through PHP.

location /rdr {
    rewrite ^/rdr/(.*)$ $1 permanent;
}

What's wrong here is it if I access http://localhost/rdr/http://google.com my browser is telling me:

Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

How do I redirect properly?

1 Answers
Related