Welcome! Log In Create A New Profile

Advanced

rewrite regex limitation

Posted by malish8632 
rewrite regex limitation
September 09, 2014 12:06PM
We encountered issue with rewrite regex on Nginx - basically we have bellow rule, which would rewrite URL like http://www.domain.com/php/api_name/xxx=1/yyy=2/zzz=3....
to hit specific PHP script and would populate $_GET with list of sent parameters. For some reason any parameters after 9th will be not set in $_GET. It adds api0, api1, api2.... unset parameters.

Any idea if there is a way to reset some default limit or solution of such rewrite would be appreciated.

Thanks

location /php/ {
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7&$8&$9&$10&$11&$12&13&14&15 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7&$8&$9&$10&$11&$12&13&14 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7&$8&$9&$10&$11&$12&13 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7&$8&$9&$10&$11&$12 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7&$8&$9&$10&$11 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7&$8&$9&$10 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7&$8&$9 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7&$8 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6&$7 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5&$6 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4&$5 break;
rewrite ^/php/([^/]+)/([^/]*)/([^/]*)/?$ /$1/$2.php?$3&$4 break;
rewrite ^/php/([^/]+)/([^/]*)/?$ /$1/$2.php?$3 break;
rewrite ^/php/([^/]+)/([^/]*)/(.+)$ /$1/$2.php? break;
rewrite ^/php/([^/]+)/([^/]*)?(.+)$ /$1/$2.php? break;
rewrite ^/php/(.+)$ /$1.php break;
return 403;
....
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready