angular – nginx page displaying instead of home page

I’m using Docker to serve an Angular application using Nginx. However, when I access my application at localhost:8080/, I’m seeing the default Nginx welcome page instead of my Angular application’s home page. I’ve checked that my Angular application is built and deployed correctly, but Nginx is not serving it as expected.



http {
    server {

        listen 80;
        location / {
            root /usr/share/nginx/html;
            index index.html;
         try_files $uri $uri/ /index.html;

        }

        # Handle JavaScript | CSS files with the correct MIME type
        location ~ \.(js|css)$ {
            root /usr/share/nginx/html;
            include /etc/nginx/mime.types;
        }

        # Catch-all location to handle refreshes on any route
        location ~ ^/.+$ {
            root /usr/share/nginx/html;
            index index.html;
            try_files $uri /index.html;
        }
    }


Read more here: Source link