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.
Look at here:
According to this link the solution is:
server {
server_name domain1.com;
rewrite ^(.*) http://www.domain1.com$1 permanent;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/user/www/domain1;
index index.php index.html index.htm;
server_name www.domain1.com;
include hhvm.conf;
}
Oh, wait. Do you mean you really want a redirect, such that if a visitor types in ‘domain.com’, they will be redirected to ‘www.domain.com’? My response doesn’t help with that, it only enables the server to handle the ‘www’ form (or both forms, depending on which version you use).
Thanks @matt. <br> <br>I’ve already added www to my DNS. <br> <br>if I added www to the domain in the etc/nginx/sites-available/mydomain, not at nginx.conf in the nginx root folder. <br> <br>That works, but counted as an extra request. so an empty page takes 2 requests, which is a bad practice. <br> <br>I believe there a way how to do that, but not sure yet how!! <br> <br>regards