Certificates installed but https not working

My domain is: www.kinetix.digital & sub domain jenkins.dev.devo.kinetix.digital

My web server is nginx

My hosting provider is: namecheap

Im using nginx to serve jenkins on Vm with ubuntu. the sub domain jenkins.dev.devo.kinetix.digital is using the nginx serverto serve jenkins with http, but with https i get 404 not found

Below is my nginx configuration file:

upstream jenkins{
    server 127.0.0.1:8080;
}

server{
    listen      80;
    server_name kinetix.digital;    
    ssl_certificate /etc/letsencrypt/live/kinetix.digital/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/kinetix.digital/privkey.pem;    

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

    proxy_buffers 16 64k;
    proxy_buffer_size 128k;

    location / {
        proxy_pass  http://jenkins;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;

        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 https;
    }

}

server{
    listen      80;
    server_name jenkins.dev.devo.kinetix.digital;
    ssl_certificate /etc/letsencrypt/live/jenkins.dev.devo.kinetix.digital/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/jenkins.dev.devo.kinetix.digital/privkey.pem;

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

    proxy_buffers 16 64k;
    proxy_buffer_size 128k;

    location / {
        proxy_pass  http://jenkins;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;

        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 https;
    }

}

I am positive the certs are valid and I haev entered them correctly in the config file, but appreciate I may have missed something

You missed DNS:

*** 8.8.8.8 can't find www.kinetix.digital: Non-existent domain

And this is problematic:

Name:      jenkins.dev.devo.kinetix.digital
Addresses: 162.0.235.101
           192.168.200.130   <<<<<<<<<<<<<<<<<< RFC 1918 [non-routable IP]
3 Likes

You've entered them in a server configuration with only listen 80; in them I don't see any ssl listen directives on port 443.

4 Likes

I got the certificates to work now on Jenkins, but as you say no 443. This I will resolve when I create an Agent on another machine

How do you mean, "an Agent on another machine"? Don't you just have to configure nginx to listen on port 443 (with ssl) too, next to port 80?

3 Likes

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