I couldn't see the difference between location /fruits { ... }
and location /fruits/ { ... }
because fruits
was the directory in my root
directory. So, to make the thing clear:
/
to the URL, so if we type in the browser http://localhost:8090/fruits
it will be always rewritten to http://localhost:8090/fruits/
, because the directory fruits
exists in the root
directory and nothing except fruits
can be matched in that casehttp://localhost:8090/fruits
will not have the trailing /
automatically added, so http://localhost:8090/fruitsalad
will be also matched