Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue using certbot with nginx

I'm actually working on a webapp, I use Reactjs for the frontend and Golang for the backend. Those 2 programs are hosted separately on 2 VMs on Google-Compute-Engine. I want to serve my app through https so I choose to use Nginx for serving the frontend in production. Firstly I made my config file for Nginx:

#version: nginx/1.14.0 (ubuntu) server {      listen 80 default_server;      listen [::]:80 default_server;       root /var/www/banshee;      server_name XX.XXX.XX.XXX; #public IP of my frontend VM       index index.html;       location / {        try_files $uri /index.html =404;      }    } 

For this part everything works as expected but after that I want to serve my App over https following this tutorial. I installed the packages software-properties-common,python-certbot-apache and certbot but when I tried

sudo cerbot --nginx certonly

I get the following message:

gdes@frontend:/etc/nginx$ sudo certbot --nginx certonly Saving debug log to /var/log/letsencrypt/letsencrypt.log Could not choose appropriate plugin: The requested nginx plugin does not appear to be installed The requested nginx plugin does not appear to be installed 

I made some searches on Google and here and I still can't figure out which plugin is missing or an other way to fix this.

Does someone have an idea tohelp me ?

Thanks a lot :)

like image 462
G.D Avatar asked Nov 09 '18 10:11

G.D


People also ask

Does Certbot restart Nginx?

You do not need to restart Nginx, but you do need to tell Nginx that the certificate has changed so that it can reload it.

Is it safe to use Certbot?

As an initiative from EFF (Electronic Frontier Foundation), Certbot is part of a web-wide effort to encrypt the entire internet for the safety and security of its users. It does what it says on the tin: it provides a secure connection between your site visitors and your site server.


2 Answers

I was trying to create let'sencrypt certificate using certbot for my sub-domain and had following issue. Command :

ubuntu@localhost:~$ certbot --nginx -d my_subdomain.website.com

Issue :

The requested nginx plugin does not appear to be installed

Solution:

Ubuntu 20+

ubuntu@localhost:~$ sudo apt-get install python3-certbot-nginx

Earlier Versions

ubuntu@localhost:~$ sudo apt-get install python-certbot-nginx

like image 153
Viraj Wadate Avatar answered Sep 20 '22 17:09

Viraj Wadate


You will need to replace

apt install python-certbot-nginx 

by

apt install python3-certbot-nginx 
like image 30
Jozott Avatar answered Sep 19 '22 17:09

Jozott