The original post: /r/nginx by /u/builder999 on 2024-07-02 15:48:49.

I have created an app on nginx and can access it with curl https://api.domain1

Now I would like to access the same api with curl https://api.domain2 and more generally to let anyone access with curl https://api.mydomain by setting a CNAME or A record that points toward api.domain1.

Can I achieve this? Do I also need to issue a ssl certificate for each domain and update the nginx configs? Is it possible to do that automatically?

Thanks a lot