I have two angular projects in my VPS, the main project is found at /home/first_app/, the second one is at /home/second_app/
This is my nginx conf:
server_name www.my_domain.com my_domain.com location /second_app { alias /home/second_app/dist; try_files $uri $uri/ /index.html =404; } location / { root /home/first_app/dist; # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html =404; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } The first app works well but I cannot access to the second app by using: mydomain.com/second_app. It always took the / location block.
In the debug log, I found:
test location "/" test location "second_app" use configuration "/" Thanks !