config angular-cli nginx subdirectory /example config angular-cli nginx subdirectory /example nginx nginx

config angular-cli nginx subdirectory /example


To allow this location to handle the URI /example without a trailing /, you could remove the trailing / from the location and alias statement.

Also, your try_files statement contains a number of strange terms, and two default actions where only one is permitted. See this document for details.

If the index.html file is at /pwd/example/dist/index.html, it needs to be represented by the URI /example/index.html.

Suggested configuration:

location /example {    alias /pwd/example/dist;    try_files $uri $uri/ /example/index.html;}

If your application works at / at the moment, but not at /example/, you may need to look at the application, and ensure that it pulls its resource files (css, js) with the correct URI prefix also.