Start a conversation

Updating SSL Certificate in Nginx for Your Domain

Overview

When a domain is not secured with the correct SSL certificate, it may result in security warnings for users accessing the site. This issue can occur if the SSL certificate is not properly installed or updated on the server. This article provides steps to update the SSL certificate in the Nginx configuration on a server, ensuring the domain is correctly secured.

Information

To update the SSL certificate in the Nginx configuration on your server, follow these steps:

  1. Convert the Certificate Files:
    • In your local environment, copy the .pfx file to the desired location.
    • Run the following commands to extract the key and certificate:
      openssl pkcs12 -in mlt-uae.pfx -nocerts -out passdock2024-2025.key -passin pass:MLG@2025# -nodes
      openssl pkcs12 -in mlt-uae.pfx -clcerts -nokeys -out passdock2024-2025.crt -passin pass:MLG@2025#
    • Replace MLG@2025# with the password provided.
  2. Update the Nginx Configuration:
    • Connect to the application instance.
    • Navigate to the SSL directory:
      cd /data/nginx/ssl
    • Open the key file in a text editor and paste the private key:
      nano passdock2024-25.key
    • Open the certificate file in a text editor and paste the certificate:
      nano passdock2024-25.crt
  3. Edit the Server Configuration:
    • Navigate to the server configuration directory:
      cd /etc/nginx/servers
    • Open the relevant server configuration file:
      nano digitalpass.mlt-uae.com.ssl.conf
    • Update the ssl_certificate and ssl_certificate_key paths to the new files you created.
  4. Reload Nginx:
    • Reload Nginx to apply the changes:
      sudo /etc/init.d/nginx reload

Ensure that the reload is successful and verify that the SSL certificate is now correctly applied to your domain.

Frequently Asked Questions

What should I do if my domain is not using the load balancer?
If your domain is not pointing to the load balancer, you need to update the SSL certificate directly in the Nginx configuration on the server hosting your application.
How can I verify if the SSL certificate is correctly applied?
After updating the Nginx configuration and reloading Nginx, access your domain via a browser to ensure there are no SSL warnings and the certificate is correctly applied.
What if I need to update the SSL certificate on the load balancer instead?
If your domain is correctly pointing to the load balancer, you should update the SSL certificate on the load balancer. Ensure the DNS records are set to point to the load balancer's DNS name.
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments