Today, I configured a rewrite for nginx, which is basically killed. In fact, I just want to put/xxx/0.mp4? Key = 123456abcde to/xxx.mp4? Segno = 0 & amp; key = 123456abcde this form has been constantly tried, but also analyzed the causes, found that some of the problems that must be paid attention to in the content settings of the content: 1. in the regular expression for rewrite, nginx only adds? Match the previous part 2. match
Today, I configured a rewrite for nginx, which is basically killed. In fact, I just want to put/xxx/0.mp4? Key = 123456abcde to/xxx.mp4? Segno = 0 & key = 123456abcde this form has been constantly trying, but also analyzed the reasons, found that some problems must be paid attention to in the content settings of the content:
1. in the regular expression for rewrite, nginx only adds? Match the previous part
2. after the matching is complete ,? The following content will be automatically appended to the url (including ?), If you do not want to append the following content, add? You can.
3. if you want? Use $ query_string
Note that do not use break last in the last configuration item of rewrite during debugging. use redirect to view the converted address. The configuration items used are as follows:
rewrite ^/(.+)/(\d+)\.mp4$ /$1.mp4?segno=$2&$query_string? last;