Question
Cant setup subdomain (address in use)?
I am not seting up my nginx virtial host blocks up properly, but I don't get how to serve a subdomain on port:80 and the main domain on port:80?
I tried creating multiple virtual hosts, but I was getting an error with server_names_hash_bucket_size 64; I had to uncomment that out inside nginx.conf to get it work and at this point I already went ahead an merged both virtual hosts into the default file.
server {
listen 80;
root /var/www/example.com/public_html/public;
index index.html index.htm;
# Make site accessible from http://example.com
server_name example.com;
}
server {
listen 80;
root /var/www/demo.example.com/public_html;
index index.html index.htm;
# Make site accessible from http://demo.example.com
server_name demo.example.com;
}
Obviously I am pointing both to port:80 but I am not sure how to configure it so they both work on port:80.
I followed https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
But I am missing something.
Add a comment
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.
×