Docker with nginx gives 404 on page reload or when entered a specific route

My URL is like: http://docker-manager…com:49193/

My dockerFile:
FROM node:14.17-alpine as base

ADD package.json /frontend/package.json

ADD package-lock.json /frontend/package-lock.json

WORKDIR /frontend

RUN npm ci --unsafe-perm

ADD . /frontend

RUN apk update && apk add git

RUN npm run build --prod --output-hashing=all

FROM nginx:alpine

COPY --from=base /frontend/dist /usr/share/nginx/html

ADD nginx.conf .


CMD [“/bin/sh”, “-c”, “envsubst < nginx.conf > /etc/nginx/conf.d/default.conf && nginx -g ‘daemon off;’”]

server {
listen 80;
listen [::]:80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;


My angular app index.html file
<!doctype html>

In my local everything works fine, but it is only the docker deployed version which when entered with route gives 404