Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Banana Pi Cookbook

You're reading from   Banana Pi Cookbook Over 25 recipes to build projects and applications for multiple platforms with Banana Pi

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781783552443
Length 200 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Ryad El-Dajani Ryad El-Dajani
Author Profile Icon Ryad El-Dajani
Ryad El-Dajani
RYAD E DAJANI RYAD E DAJANI
Author Profile Icon RYAD E DAJANI
RYAD E DAJANI
Arrow right icon
View More author details
Toc

Securing the Nginx web server using SSL


As you may also want to access the Banana Pi from the Internet, you should think about the security aspect. In the previous recipe, we browsed our web applications via the default HTTP protocol. HTTP is not encrypted and is therefore vulnerable to various attacks. In this recipe, we are going to create a so-called SSL certificate to enable the encrypted HTTPS (HTTP over SSL) protocol.

Getting ready

The following ingredients are required to enable HTTPS on our Nginx web server:

  • A running Banana Pi with a Debian-based Linux system

  • A configured network on the Banana Pi

  • A working Nginx web server as illustrated in the Setting up a web application recipe

How to do it…

We need to create an SSL certificate and add an HTTPS configuration to our Nginx web server.

Creating the certificate

We are going to create a self-signed certificate. In this recipe, we are using the hostname lemaker.

  1. Open a shell.

  2. Switch to /etc/ssl.

    $ cd /etc/ssl
    
  3. Obtain a root shell:

    $ sudo -s
    
  4. Create...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image