# IPV4 & IPV6 Virtual Hosting - address in use

**URL:** <https://www.ruby-forum.com/t/ipv4-ipv6-virtual-hosting-address-in-use/221535>\
**Category:** NGINX\
**Created:** [July 18, 2012, 8:21pm UTC](https://www.ruby-forum.com/t/ipv4-ipv6-virtual-hosting-address-in-use/221535 "2012-07-18T20:21:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [July 18, 2012, 8:21pm UTC](https://www.ruby-forum.com/t/ipv4-ipv6-virtual-hosting-address-in-use/221535/1 "2012-07-18T20:21:41Z")

</div>

I have the sollowing problem:

If i config all sites in one file all works finde, but if i have for  
each host a own config than i get the error

nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

my config File for the hosts looks like:

server {  
listen 80; ## listen for ipv4; this line is default and implied  
listen [::]:80 default\_server ipv6only=on; ## listen for ipv6

# Make site accessible from [http://localhost/](http://localhost/)

server\_name \_;

```
return 444;

```

location ~ /.ht {  
deny all;  
}  
}

server {  
listen 80;  
listen [2001:1010:18:697b::1]:80;  
…  
}

server {  
listen 80;  
listen [2001:1010:18:697b::2]:80;  
…  
}

server {  
listen 80;  
listen [2001:1010:18:697b::3]:80;  
…  
}

All server use The same IPV4 and a own IPV6.

But as i have say abdove this works only if all in the same file and not  
splited to each own… ☹

Posted at Nginx Forum:

> **[IPV4 & IPV6 Virtual Hosting - address in use](https://forum.nginx.org/read.php?2,228710,228710#msg-228710)**
>
> I have the sollowing problem: If i config all sites in one file all works finde, but if i have for each host a own config than i get the error nginx: \[emerg\] bind() to \[::\]:80 failed (98: Address already in use) my config File for the hosts looks
