P
P
pavelkunyavskiy2018-02-07 19:52:14
Nginx
pavelkunyavskiy, 2018-02-07 19:52:14

Why is there an error when issuing an SSL certificate?

There is a blockexample.com

server {
  listen 80;
  listen [::]:80;

  server_name example.online;

  root /home/example/deploy;
  index index.html;

  location / {
    try_files $uri $uri/ =404;
  }
}

server {
  listen 80;
  listen [::]:80;
  server_name www.example.online;
  return 301 $scheme://example.online$request_uri;
}

When I try to install the Lets Encrypt certificate, I get an error
Deployed Certificate to VirtualHost /etc/nginx/sites-enabled/example.online for example.online
nginx: [emerg] duplicate listen options for [::]:443 in /etc/nginx/sites-enabled/example.online:14
Rolling back to previous server configuration...
nginx restart failed:

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2018-02-07
@dimonchik2013

fix it
combine everything into one block

P
pavelkunyavskiy, 2018-02-07
@pavelkunyavskiy

The answer is here - https://serverfault.com/questions/258378/remove-ww...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question