Conflicting server name - i don't understand

Igor Sysoev is at
Thu Sep 3 16:17:19 MSD 2009

On Wed, Sep 02, 2009 at 08:47:39AM +0100, Nuno Magalh??es wrote:

> > This does not generate any errors.
> Glad to hear it.
> > (Yes, I also don't like the www prefix.)
> Do you have a specific reason for using two server{ } for the same
> domain? Other than
> > This also is *exactly* how Igor suggested that I do it.
> > But even if I didn't do it that way I would still use separate servers for
> > 80 and 443 for the same domain.
> Does the listen directive accept multiple values? Or does the server
> accept multiple listen directives? The latter seems to be true
> according to the wiki, so why the separation?

There can be several "listen" directive in one server. You can even
use HTTPS/HTTP site in single server:

server {
    listen  80;
    listen  443  default ssl;

    ssl_certificate ...
    ssl etc.

if these sites has very little difference.
However, it's better to separate them for future administration relief
and "include" common parts.

Igor Sysoev

More information about the nginx mailing list