Nginx: When the `index` and `try_files` in the same block, why the `try_files` will be processed, not the `index` directive?

Viewed 10873

The nginx.conf is as following:

http {
    server {
        listen  8080;
        server_name example.com;             
        root /tmp/test/example;
        location / {
            index index.html;
            try_files $uri /test.html;
        }

    }
}

When I access example.com:8080, it accesses the /tmp/test/example/test.html, not the index.html.

1 Answers
Related