Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

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!
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.
Accepted Answer
Hi there @jimmydeal16,
Have you tried following the steps from this tutorial here:
Basically it suggests creating a separate server block and using the following
server {
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
What you currently have in your port 80 server block is good enough, in your case as you have an SSL certificate, you might have to add one more server block for https://www redirect to https:// only:
server {
listen 443 ssl;
server_name www.yourdomain.com;
ssl_certificate /path/to/certificate.crt;
ssl_certificate_key /path/to/private/key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
return 301 https://yourdomain.com$request_uri;
}
Hope that this helps! Let me know how it goes. Regards, Bobby