Report this

What is the reason for this report?

how to set up nginx server blocks (virtual hosts)?

Posted on November 7, 2013

I have a Ubuntu LAMP server with nginx as the front end proxy to access site1.mine.com. I need to set up two more accounts/virtual hosts on the same server (site1a.mine.com, site1b.mine.com) pointing to the same IP. I have these subdomain names created and pointing to the DigitalOcean server IP. However, I can’t use the ‘How To Set Up Apache Virtual Hosts on Ubuntu 12.04 LTS’ tutorial since I am using nginx as the front end proxy. I understand that nginx doesn’t have virtual hosts, but instead uses server blocks. I’m looking for any guidance/tutorial on how to do this.

Thanks.



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.

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.