I use angular-cli to make an angular4 app. I build my app with ng-build and get the dist directory with all my files. I put that files into /var/www/html/my-app directory. Here is my config for nginx :
server {
listen 80;
listen [::]:80;
server_name $hostname;
root /var/www/html;
merge_slashes on;
location /my-app {
index index.html;
try_files $uri$args $uri$args/ /index.html;
}
}
When I try www.my-domain.com/my-app I get well my index but all the scripts file are in 404 not found because they are searched from www.my-domain.com/ and not from www.my-domain.com/my-app/
Is there someone who can help me ?
Thanks