For example, my current URL (beautified URL) is
/1/test/test
Then nginx does the processing, and the access directory is /home/data/segmentfault/1/web
After nginx Processing, the actual URL is
/1/web/index.php?test/test
Beautified URL
/2/test/test
The access directory is /home/data/segmentfault/2/web
The actual URL is
/2/web/index.php? test/test
Just select different folders based on the version number, and then the pathinfo mode will still take effect. The framework code is Yii2.
How to set the jump rules of nginx?
Or is there any relevant information? How to describe such an internal jump? Are there any proper nouns to describe it?
Use regular matching in location. When root sets the directory, read the regular matching content to assemble the path.
Related nginx terms: location, regular, set directive, map directive, root directive, alias directive.
You don’t need to do any extra settings at all with this access method. . .