Всем добрый день.
Работаю с VDS через ISPManager. Все крутится под управлением nginx. Пытаюсь через
Домены - WWW-домены выпустить letsencrypt сертификат, на что мне панель выдаёт:
Возникла ошибка при работе с WWW-доменами. Тест конфигурации web-сервера при сохранении файла '/etc/nginx/vhosts/www-root/MYSITE.conf' завершился неудачно: nginx: [emerg] "root" directive is duplicate in /etc/nginx/vhosts/www-root/MYSITE.conf:169 nginx: configuration file /etc/nginx/nginx.conf test failed
В error.log следующее:
2019/08/30 12:54:33 [emerg] 26171#26171: "root" directive is duplicate in /etc/nginx/vhosts/www-root/MYSITE.conf:169
В указанном файле я не увидел дублей директивы root; в include файлах её вообще нет. Более того, 169 строчки кода в этом файле так же нет (всего 168 строк).
Когда впервые выкатывал сайт, сертификат от letsencrypt встал без проблем. С тех пор конфиг сервера не менялся.
Гугл, к сожалению, молчит, и в каком направлении мне копать - тоже не понятно.
Файлы с конфигами:
/etc/nginx/nginx.confuser www-data;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/vhosts/*/*.conf;
client_max_body_size 128m;
server {
server_name localhost;
disable_symlinks if_not_owner;
listen 80;
listen [::]:80;
include /etc/nginx/vhosts-includes/*.conf;
location @fallback {
error_log /dev/null crit;
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://127.0.0.1:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
access_log off ;
}
}
}
/etc/nginx/vhosts/www-root/MYSITE.confserver {
client_max_body_size 1000M;
client_body_buffer_size 1000M;
fastcgi_read_timeout 6000;
listen АЙПИ_АДРЕС:80;
listen АЙПИ_АДРЕС:443 ssl;
ssl_certificate "/var/www/httpd-cert/www-root/MYSITE_le2.crtca";
ssl_certificate_key "/var/www/httpd-cert/www-root/MYSITE_le2.key";
ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
access_log /var/www/httpd-logs/MYSITE.access.log;
error_log /var/www/httpd-logs/MYSITE.error.log notice;
charset UTF-8;
server_name MYSITE www.MYSITE;
root /var/www/www-root/data/www/MYSITE;
index index.php;
try_files $uri $uri/ /index.php?$query_string;
location ^~ /.well-known/acme-challenge/ {
allow all;
default_type "text/plain";
}
location /index.php {
include /etc/nginx/fastcgi_params;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@MYSITE";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
}
# for install only
location /install.php {
include /etc/nginx/fastcgi_params;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@MYSITE";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
}
location /api.php {
fastcgi_split_path_info ^(.+\.php)(.*)$;
include /etc/nginx/fastcgi_params;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@MYSITE";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
}
location ~ /(oauth.php|link.php|payments.php) {
try_files $uri $uri/ /index.php?$query_string;
}
location ^~ /wa-data/protected/ {
internal;
}
location ~ /wa-content {
allow all;
}
location ^~ /(wa-apps|wa-plugins|wa-system|wa-widgets)/.*/(lib|locale|templates)/ {
deny all;
}
location ~* ^/wa-(cache|config|installer|log|system)/ {
return 403;
}
location ~* ^/wa-data/public/contacts/photos/[0-9]+/ {
# единственное место, где есть еще одно ипоминание root, но оно закомментированно
# root /var/www/www-root/data/www/MYSITE/;
access_log off;
expires 30d;
error_page 404 = @contacts_thumb;
}
location @contacts_thumb {
include /etc/nginx/fastcgi_params;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@MYSITE";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
fastcgi_param SCRIPT_NAME /wa-data/public/contacts/photos/thumb.php;
fastcgi_param SCRIPT_FILENAME $document_root/wa-data/public/contacts/photos/thumb.php;
}
# photos app
location ~* ^/wa-data/public/photos/[0-9]+/ {
access_log off;
expires 30d;
error_page 404 = @photos_thumb;
}
location @photos_thumb {
include /etc/nginx/fastcgi_params;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@MYSITE";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
fastcgi_param SCRIPT_NAME /wa-data/public/photos/thumb.php;
fastcgi_param SCRIPT_FILENAME $document_root/wa-data/public/photos/thumb.php;
}
# end photos app
# shop app
location ~* ^/wa-data/public/shop/products/[0-9]+/ {
access_log off;
expires 30d;
error_page 404 = @shop_thumb;
}
location @shop_thumb {
include /etc/nginx/fastcgi_params;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@MYSITE";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
fastcgi_param SCRIPT_NAME /wa-data/public/shop/products/thumb.php;
fastcgi_param SCRIPT_FILENAME $document_root/wa-data/public/shop/products/thumb.php;
}
location ~* ^/wa-data/public/shop/promos/[0-9]+ {
access_log off;
expires 30d;
error_page 404 = @shop_promo;
}
location @shop_promo {
include /etc/nginx/fastcgi_params;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@MYSITE";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
fastcgi_param SCRIPT_NAME /wa-data/public/shop/promos/thumb.php;
fastcgi_param SCRIPT_FILENAME $document_root/wa-data/public/shop/promos/thumb.php;
}
# end shop app
# mailer app
location ~* ^/wa-data/public/mailer/files/[0-9]+/ {
access_log off;
error_page 404 = @mailer_file;
}
location @mailer_file {
include /etc/nginx/fastcgi_params;
fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@MYSITE";
fastcgi_pass unix:/var/www/php-fpm/www-root.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
fastcgi_param SCRIPT_NAME /wa-data/public/mailer/files/file.php;
fastcgi_param SCRIPT_FILENAME $document_root/wa-data/public/mailer/files/file.php;
}
# end mailer app
location ~* ^.+\.(jpg|jpeg|gif|png|js|css)$ {
access_log off;
expires 30d;
}
}