Skip to content

Instantly share code, notes, and snippets.

@elinteerie
Last active October 16, 2023 15:06
Show Gist options
  • Save elinteerie/3dcda4824dce99d1f5b917d19dfedb2d to your computer and use it in GitHub Desktop.
Save elinteerie/3dcda4824dce99d1f5b917d19dfedb2d to your computer and use it in GitHub Desktop.
SSL nginx
sudo mkdir /etc/ssl/private
sudo chmod 700 /etc/ssl/private
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
##
sudo apt update
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d studentsdecides.com.ng -d www.studentsdecides.com.ng
#sites available
server {
listen 80;
server_name domainname www.domainname;
location / {
include proxy_params;
proxy_pass http://unix:/home/ubuntu/UniEvoting/evoting/app.sock;
}
listen 443 ssl; # Add SSL support here
ssl_certificate /etc/letsencrypt/live/studentsdecides.com.ng/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/studentsdecides.com.ng/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment