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.
My domain is: staging.obakr.com (currently in order to access it http://staging.obakr.com:3000/)
I ran this command: sudo certbot --nginx -d staging.obakr.com
It produced this output:
What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew & replace the certificate (may be subject to CA rate limits)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Deploying certificate
Could not install certificate
NEXT STEPS:
- The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running:
certbot install --cert-name staging.obakr.com
Could not automatically find a matching server block for staging.obakr.com. Set the `server_name` directive to use the Nginx installer.
My web server is (include version): nginx/1.24.0
The operating system my web server runs on is (include version): Amazon Linux 2023.4.20240611 (AWS EC2 instance)
My hosting provider, if applicable, is: AWS Route 53
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): certbot 2.6.0
this is my nginx configuration files in sites available
/etc/nginx/sites-available/staging.obakr.com
server {
listen 80;
listen [::]:80;
server_name staging.obakr.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name staging.obakr.com;
ssl_certificate /etc/letsencrypt/live/staging.obakr.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/staging.obakr.com/privkey.pem;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
I've already created a symlink in sites-enabled. and ran command sudo ngnix -t
and I got these results
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
and reloaded the nginx server, but still got the same error. I don't know what to do, Can you help me, please?
I'm hosting my domain on AWS Route 53 (The main domain I purchased is obakr.com, and I'm using AWS EC2 to host my web app (Nextjs)