Redirection issues

TECK nginx-forum at
Mon Jun 24 12:58:29 UTC 2013

Hello everyone,

I'm currently using Nginx 1.4.1 on CentOS 6.4 64bits and trying to perform a
redirect of this type:
location /alpha {
    location ~ ^/alpha/script.+([\d]+)$ {
        return 301 /beta/info/$1/;

The originating location is /alpha/script.php?id=328.
The redirected location is /beta/info/328/.

For some reason, the above redirect returns a 404 with the URL:
Which does not exist anymore. It looks like the URI is not parsed from the
I also tried this format, without success:
location ~ ^/alpha/script\.php?id=([\d]+)$ {

Thank you for your help.

Posted at Nginx Forum:,240299,240299#msg-240299

More information about the nginx mailing list