Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
I just want to make same post like yours... Recently, my daily script to perform the auto renew was stuck.
For testing, I run this command: certbot certonly --dry-run -v --nginx -d mydomain
This ended up with 404 error...
However when I try to use manual: certbot certonly --dry-run -v --manual -d mydomain
which then I have to manually create the folder, and make new file with specific data in it, the renew process is working.
Could run yours with manual mode? And let's share what your result, please?
Currently I try to find almost same solution like yours. I don't get it why Certbot doesn't perform like before, why it can create the folder and file automatically.
A 404 error when using the --nginx plugin usually means there is something wrong with your nginx conf. Probably that you don't have a dedicated server block to handle that domain name on port 80.
Can you post the output of this? A capital T is needed to show the active nginx conf
@dhicom Please start a new thread. A 404 error can be caused by many things. And, is often different for someone just starting rather than someone renewing like yours.
We prefer working on each person's problem in their own thread. The answers to the form you will be shown will be helpful. Thank you
--http-01-port HTTP01_PORT
Port used in the http-01 challenge. This only affects the port Certbot listens on. A conforming ACME server will still attempt to connect on port 80. (default: 80)
Which means you need to have something (like a router) mapping the incoming request from Let's Encrypt Server on port 80 to your nginx as port 81.
I tried the command that you recommended: sudo certbot --nginx -d aar.siclib.org -http-01-port 81
And I was successfully able to get the certificate for the website, however now when i try to access the website through the web browser i am getting an 503 error: Service Unavailable.
The aar.siclib.org is actually an subdomain of siclib.org which is being hosted by apache2. And so for it redirect correctly to port 81 that i want, this is what I wrote in the conf file for it in apache2:
Oh, I see. You will need to have a port 80 and port 443 VirtualHost for aar.siclib.org in your Apache server. You should be able to use whatever method you used for Apache and your base domain name.
You don't need a cert in nginx at all. Your VirtualHosts in Apache for aar domain can use HTTP to proxy to it.
Your Apache server is handling the connection from clients (like a browser) for your aar domain. So, it must have a VirtualHost for port 443 and SSL enabled. It also then should have a port 80 VirtualHost.
If you proxy from Apache to something else that is a second connection. You can use HTTP if you are on your own private network and in this case you are. No certificate is needed for that (in your case in nginx).
I think your mistake was thinking you needed a cert in nginx since the connection ends there. What I was trying to describe is that when you do a reverse proxy like you are there are two separate connections.
If you want to double check what you have please show output of these two: