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!
Hi,
You have a typo. Missing semicolon on listen 80.
I have followed these instructions but it seems like it’s not pointing in the directory I’ve created.
Are you sure these configs shouldn’t be in /etc/nginx/conf.d/ ?
This comment has been deleted
This comment has been deleted
Hey Josh,
Great article!
Just wondering, would there be anyway to setup a automatic server block creation once a new site has been added to the DNS? I have noticed there is a wildcard option stated here;
http://wiki.nginx.org/ServerBlockExample
Also because I am currently not using a domain for root, I had to setup server block for the IP, although I’m sure this should of been the root var/www/html/ folder anyway? for some reason it wasn’t picking this up and I had to create a folder var/www/IPADDRESS/html/
Any ideas?
under grant permissions chown code ,it should be “public_html” not “html” in the end
I have set up a couple of these server blocks, and every time it is set up the domains are getting files only from /usr/share/nginx/html
I have even tried creating ones with the exact code above and using http://example.com as my hostmod
If I already have server configured and PrestaShop installed on one domain, how do I create the server blocks for my other domains?
Hi I configured nginx and when I write my ip address on the browser i get “Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx.”
Then I tried to post my websites as transferred from my previous webhosting service, using this tutorial https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-on-centos-7 been very careful with folders names and sudo vim commands, everything seems fine, however when typing my domains on a web browser i get DNS error:
ERR_NAME_NOT_RESOLVED
My old registrar already points to my new IP address provided by the new VPS provider. They provided me initially a VPS with CentOs 6.7 and Zpanel, where I succesfully uploaded all my websites. A week later I decided to remove ZPanel and install some new software, so I upgraded into Centos 7.2 and am in the process of configuring LEMP server.
The digital ocean guides are a fantastic and expansive resource. I’ve applied so many of them now. This one was a gem and worked first time. Thank you!
Hi Josh Barnett!
Nice tutorial but one problem.
Your symbolic link command will not work. (Tested on Centos 7)
Instead this
sudo ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/example.com.conf
It should be this
sudo ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/