# Can two server blocks in mail module listen the same port

**URL:** <https://www.ruby-forum.com/t/can-two-server-blocks-in-mail-module-listen-the-same-port/197412>\
**Category:** NGINX\
**Created:** [October 14, 2010, 4:36am UTC](https://www.ruby-forum.com/t/can-two-server-blocks-in-mail-module-listen-the-same-port/197412 "2010-10-14T04:36:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [October 14, 2010, 4:36am UTC](https://www.ruby-forum.com/t/can-two-server-blocks-in-mail-module-listen-the-same-port/197412/1 "2010-10-14T04:36:31Z")

</div>

When I config nginx like this, it reports: “starting nginx…2010/10/12  
11:44:04 [emerg] 14955#0: duplicate “143” address  
and port pair in /opt/nginx/nginx.conf.mail.imap:19”  
Is there something I did wrong or nginx doesn’t support this?

# IMAP proxy configuration

# 

server  
{  
server\_name [test.com](http://test.com);  
listen 143;  
protocol imap;  
proxy on;  
sasl\_service\_name “imap”;  
starttls only;  
ssl\_certificate /opt/certs/test.com.crt;  
ssl\_certificate\_key /opt/certs/test.com.key;  
}

server  
{  
server\_name [foo.com](http://foo.com);  
listen 143;  
protocol imap;  
proxy on;  
sasl\_service\_name “imap”;  
starttls only;  
ssl\_certificate /opt/certs/foo.com.crt;  
ssl\_certificate\_key /opt/certs/foo.com.key;  
}

server  
{  
#server\_name default;  
listen 143;  
protocol imap;  
proxy on;  
sasl\_service\_name “imap”;  
starttls only;  
ssl\_certificate /opt/certs/nginx.crt;  
ssl\_certificate\_key /opt/certs/nginx.key;  
}

Posted at Nginx Forum:

> **[Can two server blocks in mail module listen the same port](https://forum.nginx.org/read.php?2,140361,140361#msg-140361)**
>
> When I config nginx like this, it reports: "starting nginx...2010/10/12 11:44:04 \[emerg\] 14955#0: duplicate "143" address and port pair in /opt/nginx/nginx.conf.mail.imap:19" Is there something I did wrong or nginx doesn't support...

---

<div class="post-metadata">

**Author:** ![speedfirst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@speedfirst](https://www.ruby-forum.com/u/speedfirst)\
**Post date:** [October 14, 2010, 5:55am UTC](https://www.ruby-forum.com/t/can-two-server-blocks-in-mail-module-listen-the-same-port/197412/2 "2010-10-14T05:55:56Z")

</div>

I dont think the protocol allows for virtualhosts so I would say it’s  
not possible

Sent from my iPod
