<p>Hello I am new to kubernetes and i need some help.</p>
<p>I want use kubernetes ingress path for my 2 different nuxt project.</p>
<p>First / path working well but my</p>
<p>second /v1 path not get resources like .css and .js</p>
<p>My first deployment and service yaml file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-1
  labels:
    app: nginx1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx1
  template:
    metadata:
      labels:
        app: nginx1
    spec:
      containers:
      - name: nginx1
        image: st/itmr:latest  &quot;can't show image&quot;
        ports:
        - containerPort: 80
---

apiVersion: v1
kind: Service
metadata:
  name: nginx1-svc
spec:
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: http
  selector:
    app: nginx1
</code></pre>
<p>My second deployment and service yaml file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx2
  labels:
    app: nginx2
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx2
  template:
    metadata:
      labels:
        app: nginx2
    spec:
      containers:
      - name: nginx2
        image: st/itpd:latest  &quot;can't show image&quot;
        ports:
        - containerPort: 8080
---

apiVersion: v1
kind: Service
metadata:
  name: nginx2-svc
spec:
  ports:
  - port: 8080
    targetPort: 80
    protocol: TCP
    name: http
  selector:
    app: nginx2
</code></pre>
<p>And there is the my ingress yaml file:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: nginx
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: some.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: nginx1-svc
            port:
              number: 80
      - path: /v1
        pathType: Prefix
        backend:
          service:
            name: nginx2-svc
            port:
              number: 8080
</code></pre>
<p>I tought using nginx.ingress.kubernetes.io/rewrite-target: /$1 would be work for me bu its not.</p>
<p>I don't know where is the problem so help me.</p>

<p>To clarify I am posting a community wiki answer.</p>
<p>The problem here was resolved by switching the project path.</p>
<p>See more about ingress paths <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types" rel="nofollow noreferrer">here</a>.</p>
