Currently deploying the angular App on the OpenShift Kubernates platform Using Ngnix , The issue was if i add a custom path on the Ingress , Blank page was coming , the below error is shown on the browser console.Resource interpreted as Stylesheet but transferred with MIME type text/htm.But if i change the path to just / then it's loading . Below are Docker file,ngnix config and Ingress.
**DockerFile:**
FROM node:10-alpine AS builder
WORKDIR /src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build-prod
FROM nginx:1.13.12-alpine
COPY --from=builder /src/app/dist /etc/nginx/html
COPY ./nginx.conf /etc/nginx/nginx.conf
**Ngnix config:**
pid /tmp/nginx.pid;
events{
}
http {
include mime.types;
server {
listen 9501;
server_name data-ui;
client_body_temp_path /tmp/nginx 1 2;
proxy_temp_path /tmp/nginx-proxy;
fastcgi_temp_path /tmp/nginx-fastcgi;
uwsgi_temp_path /tmp/nginx-uwsgi;
scgi_temp_path /tmp/nginx-scgi;
location / {
root /etc/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
}
**Ingress:**
apiVersion: extensions/v1beta1
kind: Ingress`enter code here`
metadata:
name:data-ui-ingress
spec:
rules:
- host: XXXXXXXXXXXXXXXXXXXXXX
http:
paths:
- path: /data
backend:
serviceName: data-ui
servicePort: 9501 ```