При запросе к http://domain.ru или http://domain.ru/index.php происходит редирект на другой сервер archive.domain-2.ru (идет первым в /etc/nginx/sites-enabled/). Если его отключить, то на следующий по списку.

Все прочие запросы типа http://domain.ru/blabla корректно редиректятся на https (но! на 443 порту domain.ru и так единственный сервер).

index.php от wordpress и по https он работает.

Конфиг сервера:

server {
listen 80;
listen [::]:80;
server_name domain.ru www.domain.ru;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;

ssl_certificate /etc/ssl/domain/ssl-bundle.crt;
ssl_certificate_key /etc/ssl/domain/domain.ru.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

root /var/www/domain;

index index.php index.html index.htm;

server_name domain.ru www.domain.ru;





location / {
try_files $uri $uri/ /index.php?$args;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}

location ~ /\.ht {
deny all;
}

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}


}

Я так понимаю, проблема в блоке location / , но в чём именно хызы.

На сервере работает пачка сайтов на WP с таким же конфигом (только без ssl).

P.S: default_server для 80 порта не помогает. Всё равно идёт редирект на archive.domain-2.ru.








 






URL записи