Configuring Nginx

Nginx will serve several important functions:

  • Redirects all requests to https.
  • Presents the SSL certificate.
  • Forwards all requests to your application.

Connect to the server with the SSH connection script.


Open Nginx configuration.

sudo nano /etc/nginx/nginx.conf

Add configuration to the http section, before #Basic Settings. Server_name should be the URL of your server followed by the IP of your server. Ssl_certificate should point to your chained certificate file.

For example:

Save and close the nano text editor: ctrl+o, ctrl+x.

Verify configuration.

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

Restart Nginx.

sudo service nginx restart

Exit the SSH session.


Certificate Test

Test the SSL certificate with SSL Checker from Website Planet.

Next: Launch!