T
T
Troodi Larson2021-09-12 20:36:24
Nginx
Troodi Larson, 2021-09-12 20:36:24

Why does nginx only process requests in the first server directive?

server {
    server_name chart.${NGINX_DOMAIN};
    listen 443 ssl;
    ssl_certificate /var/certs/localhost.crt;
    ssl_certificate_key /var/certs/localhost.key;
    
  #Тут locations...
}

server {
    server_name sample.${NGINX_DOMAIN};
    listen 443 ssl;
    ssl_certificate /var/certs/localhost.crt;
    ssl_certificate_key /var/certs/localhost.key;
    
  #Тут locations...
}


In this case, the second server is never called, but before switching to 443 ssl everything was ok, I did not find any problems in Google. What have I done wrong? That is, even if you enter sample, then chart will be processed ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2021-09-12
@ky0

Show the console output with requests - where you go, what code you get from where.
There are not so many options - either the config was not applied, or something was cached somewhere, or you are not accessing the HTTPS link.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question