Installing SSL: Nginx

The following instructions explain how to install an SSL Certificate on Nginx.

 

Step 1

Nginx requires a single file containing the SSL certificate.

The. crt and the .ca-bundle file must be merged by cat command.

Example Syntax:

cat yourdomain.crt yourdomain.ca-bundle > ssl-bundle.crt

 

Step 2

Copy the newly created ssl-bundle.crt into the /etc/ssl/certs/ directory.

The key server.key is copied to the directory/etc/ssl/private/.

 

Step 3

Open the configuration file with any editor (e.g. Notepad++, Sublime Text2) of your choice. This can usually be found in one of the following directories:

/etc/nginx/sites-available/

/usr/local/nginx/sites-available/

 

Locate the VirtualHost configuration section that you want to secure using SSL and add the following configuration.

 

Server {

 

lists 443;

 

ssl on;

ssl_certificate /etc/ssl/certs/ssl-bundle.crt;

ssl_certificate_key /etc/ssl/private/server.key;

 

#enables all versions of TLS, but not SSLv2 or 3 which are weak and now deprecated.

 

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

 

}

 

Step 4

 

Check the configuration for errors with the following command:

sudo nginx -t -t -c /etc/nginx/nginx.conf

 

If everything is fine, restart the server.

sudo /etc/init.d/nginx restart

 

Was this article helpful?

Thank you very much for your review!

Thank you very much for your review!

You have already rated this item.

Thank you for your time.

Do you require assistance?

Support

Telephone support

Domains worldwide

Europe

  • .at
  • .ch
  • .de
  • .eu
  • .fr
  • .it
  • .nl
  • .uk
  • .es
  • .pl
  • .me
  • .li

Asia

  • .ae
  • .cn
  • .hk
  • .in
  • .io
  • .jp
  • .my
  • .la
  • .sg
  • .tw
  • .ps

Generic

  • .biz
  • .com
  • .info
  • .mobi
  • .net
  • .org
  • .travel
  • .xxx
  • .pro
  • .jobs
  • .name
  • .aero

New domain extensions

  • .online
  • .sale
  • .reise
  • .hotel
  • .xyz
  • .ruhr
  • .restaurant
  • .coupon
  • .video
  • .bayern
  • .berlin
  • .hamburg
  • .koeln
  • .london
  • .reisen
  • .saarland
  • .wien
  • .bio
  • .business
  • .events
  • .haus
  • .immo
  • .immobilien
  • .international
  • .versicherung

Companies that trust us

Other products you might be interested in

Webhosting
Concentrate fully on your project! Performance and security included.
Rankingoach
Optimize your Web site and achieve top rankings.
Website optimization
SSL Certificates
For your site, more safety protect yourself from hacker attacks.
Quickly protect