I
I
ikerya2018-03-20 15:28:25
Nginx
ikerya, 2018-03-20 15:28:25

How to listen to ipv6 addresses for two domains in nginx?

Hello. I'm trying to make two domains available via IPV6. There are two configs: the first site and the second.
Both files (with the exception of the server_namessl settings) contain the following lines:

server {
  listen 80;
  listen [::]:80 ipv6only=on;

  ...
}

server {
  listen 443;
  listen [::]:443 ipv6only=on;

  ...
}

There is also a third config for processing requests directly on the server IP itself:
server {
  listen 80 default_server;
  listen [::]:80 ipv6only=on;

  server_name localhost;

  root /var/www/http;
}

When trying to start the server, nginx swears and says that duplicate listen options for [::]:443. Don't understand why duplicate if I want to listen on ipv6 on both sites. How to fix the situation, tell me, please?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Varlamov, 2018-03-20
@ikerya

ipv6only=oncan only be specified once per ip:port pair

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question