Возникли проблемы с установкой живого 2-го блока nginx - не удается заставить домен указывать на правильную корневую папку, и задача Let's Encrypt Acme не выполняется (возможно, это связано с проблемами).
Сервер - Ubuntu18.04, и я использую его как «песочницу» для работы на сайтах.
Вот доступные сайты конф для сайта, который просто перенаправляет на страницу по умолчанию nginx
server {
root /var/www/boothslop.online;
index index.php index.html index.htm index.nginx-debian.html
servername boothslop.online www.boothslop.online;
location = /favicon.ico { lognotfound off; accesslog off; }
location = /robots.txt { lognotfound off; accesslog off; allow all; }
location ~* .(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
lognotfound off;
}
location / {
#tryfiles $uri $uri/ =404;
tryfiles $uri $uri/ /index.php$isargs$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Вотсайты, доступные для сайта, который работает правильно и позволяет шифровать и находить правильную корневую папку при доступе к домену.
server {
root /var/www/webtest.tech;
index index.php index.html index.htm index.nginx-debian.html
servername webtest.tech www.webtest.tech;
location = /favicon.ico { lognotfound off; accesslog off; }
location = /robots.txt { lognotfound off; accesslog off; allow all; }
location ~* .(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
lognotfound off;
}
location / {
#tryfiles $uri $uri/ =404;
tryfiles $uri $uri/ /index.php$isargs$args;
}
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/webtest.tech/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/webtest.tech/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.webtest.tech) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = webtest.tech) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name webtest.tech www.webtest.tech;
}
Это ошибка, которую я получаю от вызова Acme
Domain: www.boothslop.online
Type: unauthorized
Detail: Invalid response from
http://www.boothslop.online/.well-known/acme-challenge/G13Ou7X8U-KMQVvT_ExNvAfK5cF-jHkobGp7hyqw8ac
[192.34.60.43]: "<html>\r\n<head><title>404 Not
Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>404
Not Found</h1></center>\r\n<hr><center>"
Большое спасибо заранее!