Hi guys,
I have a nuxt app that I deployed using the App Platform. It has different pages in subfolders like
Now I bought a cloudflare domain and used CNAME to point the domain to app-name.ondigitalocean.app
. What I would like to achieve now is, that I would like to point my domain example.com
to one of the subfolders.
example.com
should serve the content from app-name.ondigitalocean.app/website1
example.com/hello
should serve the content from app-name.ondigitalocean.app/website1/hello
From the domain perspective I read about redirects, workers and more, but I didn’t manage to achieve what I wanted. Now I would like to look for the possibilities from digitalocean perspective. I think nginx proxying should help me achieve what I need, but is that also possible on the App Platform?
I would be happy so get some directions on what I could take a look at.
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
A quick way to achieve this would be to use a $4 Droplet with Nginx and setup your proxy rules on there, eg:
That way you can point your DNS to the Droplet’s IP address and you can add as many domains as you need.
Instead of a Droplet, you might be able to achieve this with a Dockerfile and a service deployed on the App Platform:
But what I would personally advise you here is to just have two separate apps for each project. That way you can take advantage of the native App Platform routing and domain mapping instead of having to manage a separate reverse proxy service.
Is there a specific reason or a limitation why you need the two sites deployed under the same app instead of separate ones?
Best,
Bobby