How to run letsencrypt with nginx + docker?


#1

My domain is: imspro.eu

I ran this command: used a template from bitbucket that runs nginx + letsencrypt + sample page
( https://bitbucket.org/automationlogic/le-docker-compose.git)

It produced this output: I ran it several times because of some issues i have and now it says that there were too many certificate requests. This would indicate that i now have a certificate for my server?

My web server is (include version): Nginx 1.10.3

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

I can login to a root shell on my machine (yes or no, or I don’t know): yes

The problem here is the letsencrypt container installed a certificate on my server, but i am not sure how to retrieve it and use it on my website which is an asp.net core project. I am running the website with docker sqllserver and nginx… i have gone through many tutorials and articles but im not sure what i’m doing wrong. Since i have an active certificate on my machine, isn’t it just the proxy configuration that i need to adjust? Can someone assist me please


#2

The output here: https://crt.sh/?q=imspro.eu

indicates a certificate was generated.

From the sample nginx config file shown on the bitbucket page,
the ssl_certificate* lines would indicate the files you want are under
/etc/letsencrypt/live, but are inside the docker container.

So, you need to get them out of the container… docker is a little out of the scope here.
google “copy directory from docker container to host” may help you along,
or if you were following directions at Digital Ocean, pages there usually have feedback/comments.

I didn’t look at the docker-compose file, but I think every time you run docker-compose up you are requesting and creating new certificates. If you need to tweak the config, you can use something like the docker exec command there to e.g. get a shell inside the docker container, edit the config, reload nginx.


#3

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