I'm trying to follow the instructions posted here to setup LetsEncrypt with Nginx.

I'm using reverse proxy to serve open ports. The instructions say to do the following:

sudo letsencrypt certonly -a webroot --webroot-path=/var/www/html -d example.com -d www.example.com

In my case I don't have a webroot so I try:

sudo letsencrypt certonly -d example.com -d www.example.com

Which ends up bringing up a slightly different dialog which ends up saying port 80 is already in use by nginx.

How can I do this with the following nginx config:

    server {
        listen 443 default_server;
        listen [::]:443 default_server;

        server_name _;

        location / {
                proxy_pass http://localhost:3000;


The webroot is necessary as it is the mounting point of your filesystem that is presented to the internet. letsencrypt requires this to work. If you have an alternative path to /var/www/html, then use that as your webroot.

  • I updated my question with my config file to show I don't have a webroot folder. I'm just serving port 3000 on port 80. Dec 9 '16 at 0:00
  • 1
    You're on the right track, but you have to have a webroot: Dec 9 '16 at 0:03
  • "You will also want look up what your document root is set to by searching for the root directive, as the path is required to use the Webroot plugin. If you're using the default configuration file, the root will be /var/www/html." -Digital Ocean Dec 9 '16 at 0:03
  • How do we search for the root directive? I have multiple sites in /var/www/site1/html /var/www/site2/html (thank you)
    – landed
    Jun 14 '17 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.