Redirect ends up in a loop

shainp nginx-forum at nginx.us
Wed Jun 30 11:45:27 MSD 2010


Hello!

I wanted to use NginxHttpMapModule and NginxRedirect to redirect static
links to dynamic php links.

I want to redirect http://my_domain/static/static_page1.html to
http://domain_name/dynamic/zone.php?zoneid=86 by looking up the url from
a map table.

I tried this but it ends in a redirect loop. 

    [code]
map_hash_bucket_size 256;
    map $uri $dynamic_url {
        default 42;
        /static/static_page1.html 86;
        /static/static_page2.html 36;
    }
    server {
        listen       80;     
        server_name  _;
            rewrite ^
http://domain_name/dynamic/zone.php?zoneid=$dynamic_url break;
    }
[/code]

Please help me with this.
Regards,
Shain

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,103815,103815#msg-103815




More information about the nginx mailing list