Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

rewrite regex limitation

$
0
0
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;
....

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>