Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cert without nginx .conf file? #82

Closed
theautomation opened this issue Oct 13, 2021 · 2 comments
Closed

Cert without nginx .conf file? #82

theautomation opened this issue Oct 13, 2021 · 2 comments

Comments

@theautomation
Copy link

theautomation commented Oct 13, 2021

First off, I've been using your docker image for a long time now and it works fantastically with nginx thanks for that!.
I have a question. is it also possible to create a certificate manually without using a nginx.conf file? So for example via command line?

When i do certbot certonly -d mail.mydomain.nl i get the following error.

Could not bind TCP port 80 because it is already in use by another process on this system (such as a web server). Please stop the program in question and then try again.

I have to get a certificate for a docker mailserver without reverse proxy

@JonasAlfredsson
Copy link
Owner

Hi theautomation,

It is nothing I have tried myself, but I don't think there should be too difficult to do.
I believe that by default certbot starts in "standalone" mode, which means that it will try to start a webserver on port 80, but that is occupied by Nginx in this image. Take a look on how the scripts makes a "webroot" request instead, which hands over the webserver responsibility to Nginx instead. By doing that I think it should be possible to ask for any cert you want.

@theautomation
Copy link
Author

theautomation commented Oct 14, 2021

Hi JonasAlfredsson,

thanks for your reply, i have used a minimal config.conf file to get a certificate so i think this would be the best way to get a certificate without reverse proxy. When the certificate is there i can even delete the config file and the certificate renewal continues.

server {
server_name mail.theautomation.nl;
ssl_certificate /etc/letsencrypt/live/mail.theautomation.nl/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mail.theautomation.nl/privkey.pem;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants