G
G
gitdev2021-07-13 23:19:24
Nginx
gitdev, 2021-07-13 23:19:24

Why duplicate server name blocks in Nginx?

Host settings example:

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

    # SSL configuration

    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;

    . . .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-07-14
@ky0

You can not duplicate, spreading across different blocks. It's easier if you have the same processing of requests to the HTTP and HTTPS versions of the site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question