Multiple domains on Nginx with one Django app

Hi there,

I have a Django project with a domain and SSL certificate.
But now I would like to use a second domain for a subpage, but in the same Django app with the same Nginx server.

How can I use multiple domains with SSL certificates in one Django app?

Ask for an answer.
Best wishes,
Daniel

You’ll need to decide how you want to change your settings to support the new domain. You can use environment variables, config file or a separate settings file.

For example the ALLOWED_HOSTS setting will need to account for the new domain. You could have the settings file for both instances of the django app have both domains. But for a setting such as SERVER_EMAIL where the domain should likely match the domain of the web application, you’ll need to have different values.