Report this

What is the reason for this report?

How to specify the app spec ingress field for an nginx reverse proxy service component?

Posted on January 22, 2025

Goal

I need to direct all traffic through an Nginx service component for reverse proxying, routing, rate limiting, etc.

Problem

The app runs without error on my local dev environment via Docker-Compose.

I try to update my App Platform app’s app spec from the terminal via doctl apps update <app-id>, but I get back an error: 400 (request "2887fea5-dc3a-40d2-a370-83659aa5f651") errors validating app spec; first error in field "ingress.rules.rule.match.path.prefix": rule match path prefix "/" already in use by rule with component: "nginx".

What’s strange is that even if I comment out every ingress rule in the app spec, the error still occurs.

I’m not sure about how I’m messing up. Any help is appreciated.

Note: I already have a version of my app currently running on App Platform. I’m not sure if somehow an ingress rule in the currently-running app’s app spec is causing the error.

System architecture (App Platform instance)

  • Service component: Nginx container. (reverse proxy, routing, rate limiting, …)
    • The nginx service component will handle routing to the client service component, and the api service component.
  • Service component: Client container.
  • Service component: API container.

app.yml

ingress:
  rules:
    - match:
        path:
          prefix: /
      component:
        name: nginx
        preserve_path_prefix: true
    - match:
        path:
          prefix: /ws
      component:
        name: nginx
        preserve_path_prefix: true
    - match:
        path:
          prefix: /api
      component:
        name: nginx
        preserve_path_prefix: true
services:
  - name: nginx
    ...
  - name: client
    ...
  - name: api
    ...

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.