Check webserver config for missing "/" in redirect target

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., so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command: certbot renew

It produced this output: 1renew failure
– invalid host in redirect target “”.
Check webserver config for missing “/” in redirect target –
NGINX work fine. I only can’t renew the certificates.

My web server is (include version): nginx 1.14.0

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

My hosting provider, if applicable, is:

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):0.27.1

Hi @f.raffa, welcome to the community forum.

Can you please share your nginx config? One way you can find this is to run nginx -T on the server and share the result.

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


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



server {
    listen 443;

    root /var/www/;
    index index.php index.html;


1 Like

Hi @f.raffa

looks like you need


Then recheck your domain, perhaps use online tools like to check, if the redirect is now correct. No Grade R should be visible.

1 Like

I modified

https: // host / request_uri;
but the problem persists
very strange

Please share your domain name.

You can't check such things with your browser, there is too much caching.

I have already had problems with the first certificate renewal, but one morning, without any changes, I have renewed it.
Now that it is renewed again and I am having the same problem again

Did you restart/reload Nginx after making this change?

There is a new check of your domain -

First, there you see the problem - a Grade R in the last row:

Domainname Http-Status redirect Sec. G 302 0.090 A 200 0.783 B
small content: 200 0.444 B
small content: 302 0.090 A
Visible Content: Found The document has moved here . -1 0.817 R
NameResolutionFailure - The remote name could not be resolved: ''

But the real problem:

A Info: Different Server-Headers found

Your http is an Apache

Server: Apache/2.4.39 (FreeBSD) OpenSSL/1.1.1a-freebsd PHP/7.2.19

your https a nginx:

Server: nginx

The redirect comes from your Apache, so check that definition.

Is it really required to run two different server?

1 Like

That's already correct -- $request_uri includes a /.

the goal was to pass everything on the nginx server.
is what I was trying to do besides renewing the mail server certificates.
now how could I solve?

You can use such a configuration.

But then you have to check your Apache port 80 vHost, not your (not used) nginx port 80.

lacked the / apache ending …
days of work and I hadn’t noticed :frowning:

now all I have to do is configure the websites in nginx



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