The root (alias) of the location configured in nginx accesses the same address file

I want to visit http://yuming.com/B/c.html According to the normal location configuration it should be like this:

location / {

            root /data/html;

            index  index.html index.htm;

        }

The above configuration shows that I need to access c.html in the /data/html/B/ directory

    

 

But I encountered a problem on the way. I need to re-create a test website without affecting the original directory structure. Then I can access directly using the configuration of the virtual directory. For example, to access the http://yuming.com/test/B/c.html address, you can configure it as follows:

  location /test/ {

            alias /data/html/;

            index  index.html index.htm;

        }

According to the http://yuming.com/test/B/c.html address, in fact, it is still the c.html page under the /data/html /B/ directory.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326580483&siteId=291194637