Question

Getting 403 with www on domain and SSL certificate configuration

I set up django app following the next tutorial Django app

I configured all DNS records and it works fine.

I set up lets encrypt sertificate.

So, the problem is that certificate works fine on link with www.domain.net, but I get 403 forbidden. In the same time domain.net(without www) works fine, but it hasn’t SSL. How can I fix that?

Would be very grateful if somebody can help. Thanks.


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there @lavrikrom2,

It sounds like that your SSL Nginx Server block is not correct.

Can you share the content of both your Nginx Server Blocks for port 80 and 443 here so that I could advise you further on what the problem could be?

The two files are stored at the following folder:

/etc/nginx/sites-enabled

Regards, Bobby