I have a few apps running in a aws instance with Dokku. I'm using virtual hostname, and together with some DNS configuration of my registered domain, I have the following for one of them: mydomain.com is a CNAME record pointing to the aws instance address, and Dokku+nginx take care of redirecting to the correct app/process.
The path for all API calls is /parse, as I'm using the open source Parse Server. The final server url is mydomain.com/parse.
What I want to achieve, ideally, is the following: api.mydomain.com gets redirected to mydomain.com/parse, api.mydomain.com/someFunction to mydomain.com/parse/someFunction and so on.
When researching to see how this may be possible, I found that this can be done easily with nginx, like explained here in this answer.
I can even change manually the nginx config file, but I'm afraid that it will be overwritten in future changes. How can this ideally be achieved with nginx on Dokku?
You can use a customized nginx.conf.sigil in your application's repository root as explained in the nginx configuration documentation here. Short of us changing completely how we do custom nginx configuration - which we just recently did, so it's very unlikely - this is the safest route.
@josegonzalez Thanks for the quick response, I appreciate, and apologize if this is not the ideal channel to ask. Also, thanks for all the efforts in Dokku, it's really useful.
I saw this page earlier today, but couldn't understand exactly how to do it. Is there a default nginx.conf.sigil I can start from?
The example template on that page should give you the output you'd currently get with dokku's defaults.