здесь мой файл настроек
server {
root /var/www/[NAME]/latest;
index index.php index.html index.htm index.nginx-debian.html;
server_name [SITENAME].com www.[SITENAME].com [ANOTHER-SITENAME].com www.[ANOTHER-SITENAME].com;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/[SITENAME].com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/[SITENAME].com-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.[ANOTHER-SITENAME].com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = [ANOTHER-SITENAME].com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = www.[SITENAME].com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = [SITENAME].com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name [SITENAME].com www.[SITENAME].com [ANOTHER-SITENAME].com www.[ANOTHER-SITENAME].com;
return 404; # managed by Certbot
}
Everythign работает нормально, когда я открываю [SITENAME] .com
, но когда я открываю [ANOTHER-SITENAME] .com, я получаю сообщение об ошибке
Эта страница не работает [ДРУГОЕ SITENAME]. Переадресация вас слишком много раз.
почему? как это исправить?