By James Murphy
I need to direct all traffic through an Nginx service component for reverse proxying, routing, rate limiting, etc.
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.
nginx
service component will handle routing to the client
service component, and the api
service component.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
...
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hi there,
If I understand this correctly, since your Nginx component is acting as the reverse proxy for all traffic, you only need one rule with the /
prefix directed to Nginx and then Nginx will handle the rest.
Have you tried to remove any additional rules like /api
and /ws
since Nginx will handle the routing internally?
If you are still hitting the problem after the change, it might be worth reaching out to the DigitalOcean support team directly: https://do.co/support
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.