📖
Isu's Wiki
  • Welcome to Isu's Wiki
  • Linux
    • SSH Automatic Login
    • Nginx HTTPS
    • Nginx Login Page
    • OpenVPN Server
    • PPTP Client Settings
    • LVM Allocation
    • Partition and Mount
    • Vagrant and VirtualBox
    • Bind9 SRV Record
    • Git Two Remote
    • ESXi Nvidia - 525.89.02
    • Install Qemu
    • Recover network (no netplan, iproute2)
  • Kubernetes
    • Kubernetes Reset
    • x509 Certificate Renewal
  • LaTeX
    • Code Snippet with Box in LaTeX
  • Go
    • [gRPC] Generate .pb.go from .proto
  • eBPF
    • [Kprobe] Get Argument Values
    • [Cilium] TroubleShooting
    • [Python] Install BCC
  • MicroStack
    • [Microstack] Add Image
    • [Microstack] Quota Manage
    • [Microstack] Security Group
    • [Microstack] Overcommit Resources
  • CentOS
    • Change Interface Name
    • Install Vagrant with vagrant-libvirt
  • OpenStack
    • [Nova] noVNC not working
    • [Basic] OpenStack Installation
    • [Magnum] TroubleShooting
Powered by GitBook
On this page
  • Generate SSL
  • Edit Nginx Config
  • Reload Nginx
  1. Linux

Nginx HTTPS

Nginx HTTPS using Letsencrypt

Purchasing SSLs are costly. Therefore, we will be using Letsencrypt for making our Nginx web server able to use HTTPS.

Generate SSL

sudo apt-get install letsencrypt
sudo certbot certonly

Edit Nginx Config

In file /etc/nginx/conf.d/default.conf

server {
        listen 443 ssl;
        ssl_certificate /etc/letsencrypt/live/DOMAIN_NAME/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/DOMAIN_NAME/privkey.pem;
}

server {
        listen 80 default_server;
        return 301 https://$host$request_uri;
        return 404;
}

Set DOMAIN_NAME as your domain name that you have generated SSL with. The config above will also redirect HTTP to HTTPS as well

Reload Nginx

sudo systemctl restart nginx

PreviousSSH Automatic LoginNextNginx Login Page

Last updated 2 years ago