Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is: iridiandesigns.uk (also www.iridiandesigns.uk, api.iridiandesigns.uk and mail.iridiandesigns.uk)
I ran this command: certbot --nginx -d iridiandesigns.uk -d www.iridiandesigns.uk -d api.iridiandesigns.uk -d mail.iridiandesigns.uk
It produced this output:
Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: api.iridiandesigns.uk
Type: unauthorized
Detail: 2a02:4780:c:e27c::1: Invalid response from http://api.iridiandesigns.uk/.well-known/acme-challenge/Jao6KwfwXgfYZz5gCnR0k1HovxYD9SJalBdsisqndEI: 404
Domain: iridiandesigns.uk
Type: unauthorized
Detail: 2a02:4780:c:e27c::1: Invalid response from http://iridiandesigns.uk/.well-known/acme-challenge/uchV68jhRwxpwq3SmhWB7t0xuwGNWcy8GI1IJrk9QYo: 404
Domain: www.iridiandesigns.uk
Type: unauthorized
Detail: 2a02:4780:c:e27c::1: Invalid response from http://www.iridiandesigns.uk/.well-known/acme-challenge/3XMX-q3WMtrHHUh-hSSvNT1SjAQme4SVJQas8CvAKn8: 404
My web server is (include version): nginx v1.18.0
The operating system my web server runs on is (include version): Ubuntu 22.04
My hosting provider, if applicable, is: hostinger
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 2.7.2
To begin with, I am a dev, not a server admin, so I apologise if I get some of the terminology wrong.
I had set up a vps (following tutorials on digital ocean and hostinger, etc) and had the server running with certificates installed. When the certificates expired, I tried to renew them but got authentication errors. In trying to resolve it, I think I may have deleted the certificates. Now when I try to install new certificates, I get the error listed above. when I run:
nginx -s reload
I get:
nginx: [warn] could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size
nginx: [warn] conflicting server name "api.iridiandesigns.uk" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "iridiandesigns.uk" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "www.iridiandesigns.uk" on 0.0.0.0:80, ignored
The nginx config (if it helps) is:
server {
server_name iridiandesigns.uk www.iridiandesigns.uk;
root /home/stiofan/www/f_end/smccaffrey;
location / {
autoindex off;
index index.html;
# if ($http_origin ~* "^http://iridiandesigns.uk$|http://www.iridiandesigns.uk$") {
# add_header Access-Control-Allow-Origin "$http_origin";
# add_header Access-Control-Allow-Methods "OPTIONS, POST, GET";
# add_header Access-Control-Max-Age "3600";
# add_header Access-Control-Allow-Credentials "true";
# add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range";
# set $test "A";
# }
# if ($request_method = 'OPTIONS') {
# set $test "${test}B";
# }
# if ($test = "AB") {
# add_header Access-Control-Allow-Origin "$http_origin";
# add_header Access-Control-Allow-Methods "OPTIONS, DELETE, POST, GET, PATCH, PUT";
# add_header Access-Control-Max-Age "3600";
# add_header Access-Control-Allow-Credentials "true";
# add_header Access-Control-Allow-Headers "Content-Type";
# return 204;
# }
# if ($test = "B") {
# return 403;
# }
# proxy_http_version 1.1;
# proxy_cache_bypass $http_upgrade;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header X-Forwarded-Host $host;
# proxy_set_header X-Forwarded-Port $server_port;
# include proxy_params;
# proxy_pass http://unix:/run/gunicorn.sock;
try_files $uri $uri/ /index.html;
}
location /assets/ {
root /home/stiofan/www/f_end/smccaffrey;
}
location ~* ^.+\.(js|css|png|jpg|jpeg|gif|ico|html)$ {
expires max;
}
# listen 443 ssl; # managed by Certbot
# ssl_certificate /etc/letsencrypt/live/api.iridiandesigns.uk/fullchain.pem; # managed by Certbot
# ssl_certificate_key /etc/letsencrypt/live/api.iridiandesigns.uk/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 {
server_name api.iridiandesigns.uk;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
autoindex on;
root /home/stiofan/www/b_end/portfolio;
}
location /contact {
if ($http_origin ~* "^https?://iridiandesigns\.uk|www\.iridiandesigns\.uk$") {
add_header Access-Control-Allow-Origin "$http_origin" always;
add_header Access-Control_Methods "POST, OPTIONS" always;
add_header Access-Control-Max-Age "3600";
add_header Access-Control-Allow-Credentials "true" always;
add_header Access-Control-Allow-Headers "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range";
set $cors_p "A";
}
if ($request_method = 'OPTIONS') {
set $cors_p "${cors_p}B";
}
if ($cors_p = "AB") {
add_header Access-Control-Allow-Origin "$http_origin" always;
add_header Access-Control-Allow-Methods "OPTIONS, GET, POST" always;
add_header Access-Control-Max-Age "3600";
add_header Access-Control-Allow-Authentication "true";
add_header Access-Control-Allow-Headers "Content-Type";
return 204;
}
if ($cors_p = "B") {
return 403;
}
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
location / {
set $cors '';
if ($http_origin ~ '^https?://iridiandesigns\.uk|www\.iridiandesigns\.uk') {
set $cors 'true';
}
if ($cors = 'true') {
add_header Access-Control-Allow-Origin "$http_origin" always;
add_header Access-Control-Allow-Credentials "true" always;
add_header Access-Control-Allow-Methods "GET, PUT, DELETE, OPTIONS" always;
add_header Access-Control-Allow-Headers "Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With" always;
# required to be able to read Authorization header in frontend
#add_header 'Access-Control-Expose-Headers' 'Authorization' always;
}
if ($request_method = 'OPTIONS') {
add_header Access-Control-Max-Age "3600";
add_header Content-Type "text/plain charset=UTF-8";
add_header Content-Length "0";
return 204;
}
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
location ~* ^.+\.(js|css|png|jpg|jpeg|gif|ico|html)$ {
root /home/stiofan/www/b_end/portfolio;
expires max;
}
# listen 443 ssl; # managed by Certbot
# ssl_certificate /etc/letsencrypt/live/api.iridiandesigns.uk/fullchain.pem; # managed by Certbot
# ssl_certificate_key /etc/letsencrypt/live/api.iridiandesigns.uk/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 = api.iridiandesigns.uk) {
return 308 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name api.iridiandesigns.uk;
return 404; # managed by Certbot
}
server {
if ($host = www.iridiandesigns.uk) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = iridiandesigns.uk) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name iridiandesigns.uk www.iridiandesigns.uk;
return 404; # managed by Certbot
}
I have tried commenting out the directives linking the (now deleted) certificates, otherwise nginx complains that they don't exist.
I'm trying to remove the references to the old certificates and simply issue new ones, but cannot seem to get past the error listed above.
Any help is appreciated.