nginx: URL rewrites and performance
- by j0nes
I have a website where I need to change the URL structure. The old URLs look like /olddir/part1_de.htm, the new ones will look like /newdir/sub/category/anotherpage.htm. There are a lot of URL rewrites I need to do, I assume about 500 distinct rewrites in the end.
As my website gets quite a lot of traffic, my main concern is about performance at the moment. My questions are:
I assume that for each request, the rewrites block will be parsed and the regex will be evaluated. Am I right?
Will there be a performance penalty if I use these rewrites? Can nginx handle this?
Are there any "best practices" to follow when doing a lot of rewrites?