Certbot Nginx not work

My domain is: market-place.quymanh.online

I ran this command:

It produced this output:

My web server is (include version): nginx-1.27.0

The operating system my web server runs on is (include version): AWS Linux
i don't know what's wrong with my configuration nginx below at default.conf, Everything is oke but maybe the nginx not work. I checked everything about the cert keys is Ok but my website not work :<.

upstream server {
server server:3333;
}

server {
listen 443 ssl;
listen [::]:443 ssl ipv6only=on;
server_name market-place.quymanh.online www.market-place.quymanh.online;
root /usr/share/nginx/html;
server_tokens off;

# use the certificates
ssl_certificate     /etc/letsencrypt/live/market-place.quymanh.online/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/market-place.quymanh.online/privkey.pem;
ssl_session_cache shared:le_nginx_SSL:10m;
ssl_session_timeout 1440m;
ssl_session_tickets off;

ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;

ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_dhparam /etc/ssl/certs/dhparam-2048.pem;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";

# Define the specified charset to the “Content-Type” response header field
charset utf-8;

location / {
    root /usr/share/nginx/html;
    index index.html index.htm;
    try_files $uri /index.html =404;
}


# Proxy requests to the Node.js backend
location /api/ {
    proxy_pass http://server/api/;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

}

server {
listen 80 default_server;
listen [::]:80 default_server;

server_name market-place.quymanh.online www.market-place.quymanh.online;

 return 301 https://$host$request_uri;

}

Did you open TCP port 443 (https) at both the AWS networking level and on your server firewall (if applicable)?

6 Likes

OMG. Thanks.
you saved my day :heart_eyes: :heart_eyes:

5 Likes

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