Question

ssl does not work on my endpoint my domain:3002/email

Posted January 9, 2020 294 views
DigitalOceanAPIDeploymentUbuntu 18.04

hello I have problems to see my endpoint working with the ssl certificate, I have managed to make the certificate work but with https://sub.name.com, clone my github repository and install my project successfully under 1xx.2xx.xx .xx: 3002 / xxx I can see that it works correctly, but https://sub.name.com:3002/xxxx is my problem I have followed the digital ocean setup to install Nginx and my Let’s Encrypt ssl certificate in Ubuntu 18.04.
I have deleted my droplets created everything again and nothing that works for my endpoint not if I am missing something

My project is with nestJS.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

What I would suggest here is to use Nginx as a reverse proxy, so that way you could access your application directly on https://sub.name.com rather than having to specify your port at the end.

That way you will be able to use Let’s Encrypt together with Nginx.

Your Nginx Server block would look something like thins:

server {
    listen 80;
    server_name sub.name.com;

    location / {
        proxy_set_header   X-Forwarded-For $remote_addr;
        proxy_set_header   Host $http_host;
        proxy_pass         http://127.0.0.1:3002;
    }
}

Then you could use certbot to issue your Let’s Encrypt SSL, it should also automatically create the Nginx Server block for port 443 for you as well, you can follow the guide here:

https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

Hope that this helps!
Regards,
Bobby

by Mitchell Anicas
In this tutorial, we will show you how to use Let's Encrypt to obtain a free SSL certificate and use it with Nginx on Ubuntu 16.04. We will also show you how to automatically renew your SSL certificate. If you're running a different web server, simply follow your web server's documentation to learn how to use the certificate with your setup.
Submit an Answer