Serve angular-cli from dist folder with nginx

Viewed 7798

I'm trying to serve my angular-cli application from the dist folder using nginx I used this command to generate dist

ng build --prod

then I moved the dist folder to my server and this is my nginx configuration:

server {
    listen 80;

    server_name x.x.x.x;


    location /angular {

        proxy_http_version 1.1;
        root /usr/share/nginx/html/dist;
        index index.html index.htm;
        try_files $uri $uri/ angular/dist/index.html;
    }

}

now when I try to reach x.x.x.x/angular I got 404 Not Found

Whats wrong with my configuration?

1 Answers
Related