Dont see the name of my website in the list (my site should be www.pumpview.com.ng not app.pumpview.com.ng

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. https://crt.sh/?q=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: www.pumpview.com.ng

I ran this command: sudo certbot certonly --nginx

It produced this output: Which names would you like to activate HTTPS for?


1: app.pumpview.com.ng


Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):

My web server is (include version): Nginx

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

My hosting provider, if applicable, is: Digitalocean

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

1 Like

Hi @hrsadat, and welcome to the LE community forum :slight_smile:

Are you sure you are on the correct server?
If so, we should have a look at the output of:
nginx -T

Also, I find no DNS resolve for app.pumpview.com.ng.

2 Likes

Hi @rg305
Thanks.
I am on the right server which is for pumpview.com.ng; the domain app.pimpview.com.ng is nonexistent, I dont know why it shows up. Could the person deployed my website have done something wrong?
Here is the output:

root@pumpview:~# nginx -T
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
# 
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}

# configuration file /etc/nginx/modules-enabled/50-mod-http-image-filter.conf:
load_module modules/ngx_http_image_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-xslt-filter.conf:
load_module modules/ngx_http_xslt_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-mail.conf:
load_module modules/ngx_mail_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-stream.conf:
load_module modules/ngx_stream_module.so;

# configuration file /etc/nginx/mime.types:

types {
    text/html                             html htm shtml;
    text/css                              css;
    text/xml                              xml;
    image/gif                             gif;
    image/jpeg                            jpeg jpg;
    application/javascript                js;
    application/atom+xml                  atom;
    application/rss+xml                   rss;

    text/mathml                           mml;
    text/plain                            txt;
    text/vnd.sun.j2me.app-descriptor      jad;
    text/vnd.wap.wml                      wml;
    text/x-component                      htc;

    image/png                             png;
    image/tiff                            tif tiff;
    image/vnd.wap.wbmp                    wbmp;
    image/x-icon                          ico;
    image/x-jng                           jng;
    image/x-ms-bmp                        bmp;
    image/svg+xml                         svg svgz;
    image/webp                            webp;

    application/font-woff                 woff;
    application/java-archive              jar war ear;
    application/json                      json;
    application/mac-binhex40              hqx;
    application/msword                    doc;
    application/pdf                       pdf;
    application/postscript                ps eps ai;
    application/rtf                       rtf;
    application/vnd.apple.mpegurl         m3u8;
    application/vnd.ms-excel              xls;
    application/vnd.ms-fontobject         eot;
    application/vnd.ms-powerpoint         ppt;
    application/vnd.wap.wmlc              wmlc;
    application/vnd.google-earth.kml+xml  kml;
    application/vnd.google-earth.kmz      kmz;
    application/x-7z-compressed           7z;
    application/x-cocoa                   cco;
    application/x-java-archive-diff       jardiff;
    application/x-java-jnlp-file          jnlp;
    application/x-makeself                run;
    application/x-perl                    pl pm;
    application/x-pilot                   prc pdb;
    application/x-rar-compressed          rar;
    application/x-redhat-package-manager  rpm;
    application/x-sea                     sea;
    application/x-shockwave-flash         swf;
    application/x-stuffit                 sit;
    application/x-tcl                     tcl tk;
    application/x-x509-ca-cert            der pem crt;
    application/x-xpinstall               xpi;
    application/xhtml+xml                 xhtml;
    application/xspf+xml                  xspf;
    application/zip                       zip;

    application/octet-stream              bin exe dll;
    application/octet-stream              deb;
    application/octet-stream              dmg;
    application/octet-stream              iso img;
    application/octet-stream              msi msp msm;

    application/vnd.openxmlformats-officedocument.wordprocessingml.document    docx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          xlsx;
    application/vnd.openxmlformats-officedocument.presentationml.presentation  pptx;

    audio/midi                            mid midi kar;
    audio/mpeg                            mp3;
    audio/ogg                             ogg;
    audio/x-m4a                           m4a;
    audio/x-realaudio                     ra;

    video/3gpp                            3gpp 3gp;
    video/mp2t                            ts;
    video/mp4                             mp4;
    video/mpeg                            mpeg mpg;
    video/quicktime                       mov;
    video/webm                            webm;
    video/x-flv                           flv;
    video/x-m4v                           m4v;
    video/x-mng                           mng;
    video/x-ms-asf                        asx asf;
    video/x-ms-wmv                        wmv;
    video/x-msvideo                       avi;
}

# configuration file /etc/nginx/sites-enabled/app.pumpview.com.ng:
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 5000 default_server;
        listen [::]:5000 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/app.pumpview.com.ng;

        # Add index.php to the list if you are using PHP
        index index.html;

        server_name app.pumpview.com.ng;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass PHP scripts to FastCGI server
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
        #       fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#       listen 80;
#       listen [::]:80;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#               try_files $uri $uri/ =404;
#       }
#}

# configuration file /etc/nginx/sites-enabled/backend.pumpview.com.ng:

# configuration file /etc/nginx/sites-enabled/default:
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html/vue/app/dist;

        # Add index.php to the list if you are using PHP
        index index.nginx-debian.html index.html index.htm;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass PHP scripts to FastCGI server
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
        #       fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#       listen 80;
#       listen [::]:80;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#               try_files $uri $uri/ =404;
#       }
#}

# configuration file /etc/nginx/sites-enabled/pumpview.com.ng:
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 3000 default_server;
        listen [::]:3000 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html/vue/app/dist;

        # Add index.php to the list if you are using PHP
        index index.nginx-debian.html index.html index.htm;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass PHP scripts to FastCGI server
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
        #       fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#       listen 80;
#       listen [::]:80;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#               try_files $uri $uri/ =404;
#       }
#}

2 Likes

This line picks up additional site configuration files from /etc/nginx/sites-enabled/ which in turn probably points to /etc/nginx/sites-available/ where you'll likely find the config for app.pumpview.com.ng.

4 Likes

Because it's in a server_name directive.

If you want a domain to appear in Certbot, it needs to be in a server_name directive.

Anyhow, you don't need to add it. If the server is already answering for that domain, you can specify it manually:

certbot [your options and commands] -d yourdomain.com -d yourotherdomain.com

2 Likes

8.8.8.8 can't find app.pumpview.com.ng: Non-existent domain

2 Likes

I was referring to the other domain, www.pumpview.com.ng

2 Likes

Thank you for this suggestion. It got the certificate but was unable to install it. I am looking to see how to "set the server_name directive to use the Nginx installer".

root@pumpview:~# certbot --nginx -d pumpview.com.ng
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for pumpview.com.ng

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/pumpview.com.ng/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/pumpview.com.ng/privkey.pem
This certificate expires on 2022-06-28.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Could not install certificate

NEXT STEPS:
- The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running:
  certbot install --cert-name pumpview.com.ng

Could not automatically find a matching server block for pumpview.com.ng. Set the `server_name` directive to use the Nginx installer.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
2 Likes

You just edit the appropriate nginx config file (in /etc/nginx/sites-enabled, usually) -- or you create a new one.

4 Likes

Okay thanks, I am installing filezilla to try that.

By the way, I checked the default server and it shows the following. Doesnt this indicate that my website "pumpview.com.ng" is enabled?

root@pumpview:~# grep -R default_server /etc/nginx/sites-enabled/
/etc/nginx/sites-enabled/pumpview.com.ng:       listen 3000 default_server;
/etc/nginx/sites-enabled/pumpview.com.ng:       listen [::]:3000 default_server;
/etc/nginx/sites-enabled/pumpview.com.ng:       # listen 443 ssl default_server;
/etc/nginx/sites-enabled/pumpview.com.ng:       # listen [::]:443 ssl default_server;
/etc/nginx/sites-enabled/app.pumpview.com.ng:   listen 5000 default_server;
/etc/nginx/sites-enabled/app.pumpview.com.ng:   listen [::]:5000 default_server;
/etc/nginx/sites-enabled/app.pumpview.com.ng:   # listen 443 ssl default_server;
/etc/nginx/sites-enabled/app.pumpview.com.ng:   # listen [::]:443 ssl default_server;
/etc/nginx/sites-enabled/default:       listen 80 default_server;
/etc/nginx/sites-enabled/default:       listen [::]:80 default_server;
/etc/nginx/sites-enabled/default:       # listen 443 ssl default_server;
/etc/nginx/sites-enabled/default:       # listen [::]:443 ssl default_server;
1 Like

The file name doesn't have any importance at all. Just the contents matter.

Look for the server_name directive (use grep the same way)

3 Likes

You can't have two default servers for the same IP:port.

5 Likes

I managed to edit the file and the certificate installation was successful. However, the website is still not accessible via https. I checked using whynopadlock and I got the message below. I will search google, but if there is quick fix you know about I will appreciate that. Thanks.

Forcing the use of HTTPS:// on your site will ensure that visitors to your site are always using https://pumpview.com.ng and aren't able to access an insecure http://pumpview.com.ng URL. This is recommended since if a visitor does access your site as http://pumpview.com.ng everything will be marked as "Not Secure".

Below code is for forcing HTTPs on an Apache webserver. If you are using another webserver such as lighttpd, nginx, etc you will need to contact your web hosting provider for assistance.

Add the following code to the .htaccess file in your webhosting account:

RewriteEngine On RewriteCond %{HTTP_HOST} pumpview.com.ng [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.)$ https://pumpview.com.ng/$1 [R,L]*

Once this change is made your site will no longer be accessible on the insecure "http://pumpview.com.ng" URLs and all visitors will be redirected to "https://pumpview.com.ng" instead.

1 Like

If Certbot was able to install, you can just run

certbot enhance --redirect

to solve that.

3 Likes

Also, your http site and your https site serve different websites.

And you might want to avoid the default Certbot SSL config, as it's probably a bit too modern. Have a look on ssl-config.mozilla.org.

3 Likes

In a normal situation, I would agree.
But it seems this is NOT a normal situation, there was no HTTP vhost for that name.
At best, certbot would add a redirect to the default vhost only for that single name.
OR
Following the advice of WhyNoPadlock, you would use an .htaccess file to accomplish the redirection.
I would advise against using such a file for redirection and instead...
For your nginx try something like this:
[replace all HTTP vhosts with this single HTTP vhost config file (which may already be your situation)]

server { # default server
  listen 80 default;      # make it the default for all HTTP requests IPv4
  listen [::]:80 default; # make it the default for all HTTP requests IPv6
  server_name _;
  location ^/(?!\.well-known) {            # skip challenge requests
    return 301 https://$host$request_uri;  # send all requests to HTTPS
  }# location
  root /new/dedicated/challenge/path;      # path for challenge requests
}# server

Then you may have to use --webroot -w /new/dedicated/challenge/path to ensure that all your future certs are handled correctly by certbot.

3 Likes

Agreed, but I'd go with

location /.well-known/acme-challenge/ {
    root /path/to/dedicated/webroot;
}
location / {
    return 301 https://$host$request_uri;
}
3 Likes

So it is gonna be something like this?

server { # default server
  listen 80 default;      # make it the default for all HTTP requests IPv4
  listen [::]:80 default; # make it the default for all HTTP requests IPv6
  server_name _;
  location /.well-known/acme-challenge/ {
    root /path/to/dedicated/webroot;
}
location / {
    return 301 https://$host$request_uri;
}

You skipped a curly brace } closing the server block but yes.

Also, use an actual directory in the root directive (make an empty one) and make sure Certbot knows about it.

4 Likes

Okay thanks, I will add that.

About the location to add it, I was looking in the var/www directory but couldn't find anything related. Do I just add the file in the root folder?

2 Likes