By Frederik
I am trying to setup er reverse proxy for my app platform. I have created App A, that works as a NGINX reverse proxy, that either shows content from App A if it’s from rezite.com or app B if it’s a subdomain. However. I can’t get it to work? How can I build such a structure with App platform
# App A: handles rezite.com and rezite.dk server { listen 80; server_name rezite.com rezite.dk; location / { proxy_pass http://test-analytics-app-g5dqp.ondigitalocean.app; # Replace with App A's container name + port proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } # App B: handles all subdomains of rezite.com and rezite.dk server { listen 80; server_name *.rezite.com *.rezite.dk; location / { proxy_pass http://rezite-spaces.ams3.cdn.digitaloceanspaces.com; # Replace with App B's container name + port proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
Am I doing anything wrong?
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!
Hey Frederik,
On App Platform you don’t need to run your own Nginx proxy. App Platform already terminates TLS and handles ingress. The supported way is to map your domains and subdomains directly to the app that should serve them:
rezite.com
and rezite.dk
to App A*.rezite.com
and *.rezite.dk
to App BA few important notes:
Wildcards are supported, but you must add the root domain first before adding a wildcard.
Wildcards aren’t allowed in the subdomain routing block of an app spec, you’d have to list those explicitly if you use subdomain routing.
Check out the docs: https://docs.digitalocean.com/products/app-platform/how-to/manage-domains/
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.