# Can't set the SSL on Ubuntu VPS properly

**URL:** <https://community.letsencrypt.org/t/cant-set-the-ssl-on-ubuntu-vps-properly/209857>\
**Category:** Help\
**Created:** [December 10, 2023, 11:18pm UTC](https://community.letsencrypt.org/t/cant-set-the-ssl-on-ubuntu-vps-properly/209857 "2023-12-10T23:18:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrnovadev](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mrnovadev/32/76265_2.png) [@mrnovadev](https://community.letsencrypt.org/u/mrnovadev)\
**Post date:** [December 10, 2023, 11:18pm UTC](https://community.letsencrypt.org/t/cant-set-the-ssl-on-ubuntu-vps-properly/209857/1 "2023-12-10T23:18:03Z")

</div>

Hi everyone:)

Im facing the isue that you can see below when im trying to install SSL certificate to me domain on an VPS Ubuntu Enviroment. Take on count that DNS are setted up correctly but it seems like certbot cant' acces to some files.

Here's also my Nginx file if u need:

server {  
listen 80;  
server\_name [mrnovaoficial.com](http://mrnovaoficial.com) [www.mrnovaoficial.com](http://www.mrnovaoficial.com);

```
root /root/MrNovaWebSite/build; # Path to the React app's build directory
index index.html;

location / {
    try_files $uri $uri/ /index.html;
}

location ~ /.well-known/acme-challenge {
    allow all;
    root /var/www/html; # Cambia esta línea
    try_files $uri =404;
}

```

}

My domain is:

[www.mrnovaoficial.com](http://www.mrnovaoficial.com)

I ran this command:

sudo certbot --nginx -d [mrnovaoficial.com](http://mrnovaoficial.com) -d [www.mrnovaoficial.com](http://www.mrnovaoficial.com)

It produced this output:

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:  
Domain: [mrnovaoficial.com](http://mrnovaoficial.com)  
Type: unauthorized  
Detail: 2a02:4780:8:1027:0:1760:d9e4:2: Invalid response from [http://mrnovaoficial.com/.well-known/acme-challenge/C6jLRZ8ijm\_bILb5OGQ4ayEOb8KWKENf1GBzqXbYq6E:](http://mrnovaoficial.com/.well-known/acme-challenge/C6jLRZ8ijm_bILb5OGQ4ayEOb8KWKENf1GBzqXbYq6E:) 404

Domain: [www.mrnovaoficial.com](http://www.mrnovaoficial.com)  
Type: unauthorized  
Detail: 2a02:4780:8:1027:0:1760:d9e4:2: Invalid response from [http://www.mrnovaoficial.com/.well-known/acme-challenge/vRBqEji6GmKqjBOmEBNLdpAyBsg6Sz3-i20gPO6l7-c:](http://www.mrnovaoficial.com/.well-known/acme-challenge/vRBqEji6GmKqjBOmEBNLdpAyBsg6Sz3-i20gPO6l7-c:) 404

Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

Hostinger

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of `certbot --version` or `certbot-auto --version` if you're using Certbot):

---

<div class="post-metadata">

**Author:** ![mrnovadev](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mrnovadev/32/76265_2.png) [@mrnovadev](https://community.letsencrypt.org/u/mrnovadev)\
**Post date:** [December 10, 2023, 11:23pm UTC](https://community.letsencrypt.org/t/cant-set-the-ssl-on-ubuntu-vps-properly/209857/2 "2023-12-10T23:23:36Z")

</div>

Here's more info if u need:

IP SSH

195.35.25.54

Nombre de usuario SSH

root

Puerto SSH predeterminado

22

IPv6

2a02:4780:28:6df0::1

Heres all my DNS files:

| CNAME | hostingermail-b.\_domainkey | 0 | [hostingermail-b.dkim.mail.hostinger.com](http://hostingermail-b.dkim.mail.hostinger.com) | 300 | |
| --- | --- | --- | --- | --- | --- |
| CNAME | hostingermail-a.\_domainkey | 0 | [hostingermail-a.dkim.mail.hostinger.com](http://hostingermail-a.dkim.mail.hostinger.com) | 300 | |
| CNAME | www | 0 | [mrnovaoficial.com](http://mrnovaoficial.com) | 300 | |
| CNAME | autodiscover | 0 | [autodiscover.mail.hostinger.com](http://autodiscover.mail.hostinger.com) | 300 | |
| CNAME | fk7yk6agxl2j | 0 | [gv-37sc2ryhqvxiya.dv.googlehosted.com](http://gv-37sc2ryhqvxiya.dv.googlehosted.com) | 14400 | |
| CNAME | autoconfig | 0 | [autoconfig.mail.hostinger.com](http://autoconfig.mail.hostinger.com) | 300 | |
| CAA | @ | 0 | 0 issuewild [globalsign.com](http://globalsign.com) | 14400 | |
| CAA | @ | 0 | 0 issuewild [sectigo.com](http://sectigo.com) | 14400 | |
| CAA | @ | 0 | 0 issuewild [letsencrypt.org](http://letsencrypt.org) | 14400 | |
| CAA | @ | 0 | 0 issuewild [digicert.com](http://digicert.com) | 14400 | |
| CAA | @ | 0 | 0 issuewild [comodoca.com](http://comodoca.com) | 14400 | |
| CAA | @ | 0 | 0 issue [sectigo.com](http://sectigo.com) | 14400 | |
| CAA | @ | 0 | 0 issue [letsencrypt.org](http://letsencrypt.org) | 14400 | |
| CAA | @ | 0 | 0 issue [globalsign.com](http://globalsign.com) | 14400 | |
| CAA | @ | 0 | 0 issue [digicert.com](http://digicert.com) | 14400 | |
| CAA | @ | 0 | 0 issue [comodoca.com](http://comodoca.com) | 14400 | |
| AAAA | @ | 0 | 2a02:4780:28:6df0::1 | 1800 | |
| TXT | @ | 0 | v=spf1 include:\_spf.mail.hostinger.com ~all | 3600 | |
| MX | @ | 10 | [mx2.hostinger.com](http://mx2.hostinger.com) | 14400 | |
| MX | @ | 5 | [mx1.hostinger.com](http://mx1.hostinger.com) | 14400 | |
| A | @ | 0 | 195.35.25.54 | 14400 | |

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [December 10, 2023, 11:25pm UTC](https://community.letsencrypt.org/t/cant-set-the-ssl-on-ubuntu-vps-properly/209857/3 "2023-12-10T23:25:07Z")

</div>

You have an AAAA record in the DNS for IPv6 - that's good. Let's Encrypt favors IPv6 and you see its address in the error.

The problem is your nginx server block is not listening for IPv6 connections. You need to add this line below your current `listen 80;` statement:

```nohighlight
listen [::]:80;

```

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [December 11, 2023, 12:31am UTC](https://community.letsencrypt.org/t/cant-set-the-ssl-on-ubuntu-vps-properly/209857/4 "2023-12-11T00:31:49Z")

</div>

> [@mrnovadev](#):
>
> `root /var/www/html; # Cambia esta línea`

Have you changed that line?

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [December 11, 2023, 1:40am UTC](https://community.letsencrypt.org/t/cant-set-the-ssl-on-ubuntu-vps-properly/209857/5 "2023-12-11T01:40:38Z")

</div>

> [@rg305](#):
>
> Have you changed that line

Good catch. The --nginx plug-in does not even need such a thing as it inserts its own redirects. But, yeah, they should remove that whole `location` block to not expose that path to stray queries.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [January 10, 2024, 1:41am UTC](https://community.letsencrypt.org/t/cant-set-the-ssl-on-ubuntu-vps-properly/209857/6 "2024-01-10T01:41:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
