after i add ssl ( port 80 and port 443 )i go to https://www.The example.com/ it give (Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx.)
and http://www.The example.com/ go to (Success!The example .com server block is working!)
please advise
i go through https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @iot,
It seems to me like you don’t have a Nginx config listening for port 443 for your domain.
Usually, Let’s Encrypt should create that automatically for you and the config should be found at /etc/nginx/sites-available. Go there and see if you can spot an SSL config for your domain theexample.com.
If you can’t create a new config following the same pattern from the https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04#step-5-setting-up-server-blocks-recommended tutorial. The config should look like this:
server {
listen 443 ssl;
server_name example.com www.example.com;
root /var/www/example.com/html;
index index.html index.htm index.nginx-debian.html;
server_name your_domain www.your_domain;
ssl_certificate /path/to/SSL/CERT/www.example.com.crt;
ssl_certificate_key /path/to/SSL/Key/www.example.com.key;
location / {
try_files $uri $uri/ =404;
}
}
Once you create the config, follow the other steps in the mentioned tutorial to finish the setup.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.