So I’m trying to use the Digital Ocean App Platform. I have a node app deployed with the following app.yaml config:
name: my-app
services:
- name: admin
github:
repo: my-repo/admin
branch: main
deploy_on_push: true
build_command: npm run build
run_command: npm run start
internal_ports:
- 3000
This app should now be served at /admin
.
To achieve that I added a nginx deployment to proxy to the internal 3000 port:
server {
listen 80;
listen [::]:80;
server_name xxx.ondigitalocean.app;
location /admin/ {
set $app1 http://admin:3000;
proxy_pass $app1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
When accessing my deployed app at https://xxx.ondigitalocean.app/admin/
I’m seeing We encountered an error when trying to load your application and your page could not be served. Check the logs for your application in the App Platform dashboard.
Checking the logs reveals: *424 no resolver defined to resolve admin
I can’t find anything on how to debug internal routing of the app platform and it seems like it’s related to that so I highly appreciate every sort of hint on this!
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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
I believe that there is no need to add an Nginx proxy for this. You can deploy multiple components under one App Platform and you can define the the route address for each component directly.
To define this you can adjust the ‘HTTP Request Route’ value for the specific component.
For more information on how to manage the services on your app platform you can take a look at the documentation here:
https://docs.digitalocean.com/products/app-platform/how-to/manage-services/
For the complete list of the available App Specs, you can reference the docs here:
https://docs.digitalocean.com/products/app-platform/reference/app-spec/
Also all service components in the same app can communicate over a local network using the component name as the address. Additionally services can be configured to be “internal services” by specifying “internal_ports” property in the app spec. Here is an example repository utilizing this feature. I agree the documentation for this feature is lacking, and we are working on enhancing it with more details and examples.
Let me know if you have any questions!
Best,
Bobby