Question

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

Posted November 7, 2013 3.3k views
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.

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.

×
1 answer
Did you checkout https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
Submit an Answer