Error getting validation data

You do not have a server block for mail.jv80.se listening on port 80.

So, nginx would use the default for that domain name. In your config it is the first server block for port 80 which is this one

# configuration file /etc/nginx/sites-enabled/00-default.conf:
#
# Note: This file must be loaded before other virtual host config files,
#
# HTTP
server {
    listen 80;
    server_name _;
}

Note there is no root folder specified. In which case nginx uses its default of html. Which of course is not what you told Certbot and is probably not a valid folder on your system.

So, that explains why this does not work.

Fixing it is a different problem. Your nginx config is confusing.

I am not sure what you are trying to achieve in this config. You have a config file named for mail.mediasafe.pro (and for mail.jv80.se) but the server_names in those config files are not that domain name (it is the apex name instead). The name of the file does not have to match the server_name but it looks like you intended to match them and never did.

This server block won't be used for mail.mediasafe.pro requests (your default server block above will be).

# configuration file /etc/nginx/sites-enabled/mail.mediasafe.pro.conf:

# HTTP
server {
    # Listen on ipv4
    listen 80;
    #listen [::]:80;

    server_name mediasafe.pro;

    # Redirect all insecure http:// requests to https://
    return 301 https://$host$request_uri;
}

If you do not know how to proceed I maybe could walk you through fixing it. But, I don't know that I'll have that much time. I would need to see output of this too

sudo certbot certificates
1 Like