1

Need some help with Nginx write rule such that:

All urls of type:-

/1.1.1/xyz/abc/z.js
/2.2.2/xyz/def/c.css

are re-directed to

/xyz/abc/z.js
/xyz/def/c.css

Want to exclude the numeric part which comes at the beginning of URL.

4

2 回答 2

3
location ~ ^/[0-9\.]+(/.*) {
    try_files $1 $1/;
}
于 2013-06-26T08:21:55.330 回答
0

this will work

rewrite ^/(d+).(d+).(d+)/(.+)$ /$1;

于 2013-06-26T04:52:53.500 回答