server {
charset utf-8;
client_max_body_size 128M;
listen 443 ssl;
listen [::]:443 ssl;
server_name admin.example.ru;
root /var/www/admin.site/web;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
expires off;
try_files $uri =404;
}
location ~ ^/assets/.*\.php$ {
deny all;
}
ssl_certificate /etc/letsencrypt/live/admin.example.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/admin.example.ru/privkey.pem; # managed by Certbot
}
server {
charset utf-8;
client_max_body_size 128M;
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
server_name www.example.ru example.ru;
root /var/www/html/web;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
expires off;
try_files $uri =404;
}
ssl_certificate /etc/letsencrypt/live/example.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.ru/privkey.pem; # managed by Certbot
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name www.example.ru example.ru;
rewrite ^ https://example.ru$request_uri? permanent;
return 404; # managed by Certbot
}
Поддомен admin.example.ru почему перекрывает exampl.ru. Всегда происходит редирект на admin.example.ru.