By mpasquali
I must have been a bit confused as to whether I needed to create a domain.com server block as well as a Django Project server block. I created both and set up Certbot for the domain.com. I looked into my sites-available config files and the domain.com config has certbot configured, whereas the Django Project config file does not. I need to find out whether I should remove the link in sites-enabled for the domain.com and edit my config for the Django Project: server as the domain.com www.domain.com instead of an IP address. Then rerun certbot to install a cert for the Django Project, so that config file shows the certbox configuration. I’m thinking I should only have the Django Project server block, not the domain.com server block as well. Please advise.
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!
Accepted Answer
Hi there,
In case that your domain name has to show the content of the Django project, then it is best to have just a single server block.
What you could do is update the server_name
directive for your Django server block and set it to your domain name, after that disable the second server block that has been set up for your domain name only.
Then once you run certbot
it would generate a second server block for port 443. That way you would have two server blocks: one for HTTP and one for HTTPS.
Hope that this helps! Best, Bobby
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.