Let's Encrypt certbot instructions causes an NGiNX error
See original GitHub issueDetails
Description
When using the instructions provided in nginxconfig.io the resulting website configuration causes NGiNX to error out.
Steps to reproduce
Setup a reverse proxy frontend website, set it to create a new certificate and run the instructions listed.
Screenshots
Expected behavior
Certbot should obtain the cert just fine
Error Message
nginx: [emerg] no "ssl_certificate" is defined for the "listen ... ssl" directive in /etc/nginx/conf.d/nextcloud.domain.com.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
OS Version
Ubuntu 20.04 (all updates installed)
NGiNX Version
1.18 (NGiNX repo)
Website configuration
server {
listen 443;# ssl http2;
listen [::]:443;# ssl http2;
server_name nextcloud.domain.com;
root /var/www/nextcloud.domain.com;
# SSL
#;#ssl_certificate /etc/letsencrypt/live/nextcloud.domain.com/fullchain.pem;
#;#ssl_certificate_key /etc/letsencrypt/live/nextcloud.domain.com/privkey.pem;
#;#ssl_trusted_certificate /etc/letsencrypt/live/nextcloud.domain.com/chain.pem;
# security
include nginxconfig.io/security.conf;
# logging
access_log /var/log/nginx/nextcloud.domain.com.access.log;
error_log /var/log/nginx/nextcloud.domain.com.error.log warn;
# index.php fallback
location ~ ^/api/ {
try_files $uri $uri/ /index.php?$query_string;
}
# reverse proxy
location / {
proxy_pass http://192.168.7.204;
include nginxconfig.io/proxy.conf;
}
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name nextcloud.domain.com;
include nginxconfig.io/letsencrypt.conf;
location / {
return 301 https://nextcloud.domain.com$request_uri;
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
Common Certbot Errors & Solutions - Webdock.io
Let's Encrypt Certbot sometimes kicks up a fuss. In this article we document the most commonly encountered errors and how to solve them....
Read more >Problem with certbot and nginx - Help
Hi, I need help setting renewing the certificate for my domain. I'm not that experienced with it but I am trying to use...
Read more >Error in Nginx Proxy Manager Let's Encrypt - Help
I am trying to get an ssl certificate in nginx proxy manager but unable to the follwoing is the error. Error: Command failed:...
Read more >Nginx getting internal error when asking for new ssl cert - Help
It produced this output: internal error. My web server is (include version): Synology using Docker - nginx. The operating system my web ...
Read more >Certbot: nginx error - Help - Let's Encrypt Community Support
It produced this output: ... Thanks! The problem appears to be caused by duplicate virtual hosts. Both /etc/nginx/sites-enabled/default and /etc/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
very odd, i will try again tomorrow
👋 Hey folks, so I’ve created a PR to try and get around this issue with a couple of tweaks:
;
and#
in the listen rules, just incase nginx is parsing that badlyssl off;
explicitly in all server blocks during the certbot setup – this rule is deprecated but still supportedIf someone who can reproduce the issue described here could test out the build preview in #240 and report back, that’d be ace!