I have Magneto 2 installed on the server and the main site is working with www.example.com and loading Magneto 2 root directory. Now have created sub-folder called "ksa" inside Magento root directory.
I need to load main site with "ksa"
For example
example.com/test.php to example.com/ksa/test.php
My nginx configuration
location ~ /ksa/ {
rewrite ^/ksa/$ http://example.com/ permanent;
}