Skip to content

Instantly share code, notes, and snippets.

@emelyanov-dev
Last active September 28, 2022 10:26
Show Gist options
  • Save emelyanov-dev/41525109b78b3aee38eb2607f68799ff to your computer and use it in GitHub Desktop.
Save emelyanov-dev/41525109b78b3aee38eb2607f68799ff to your computer and use it in GitHub Desktop.

Deploy cheat sheet

SSH

ssh-keygen -m PEM -t rsa -b 4096
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_rsa
service sshd reload

Nginx

sudo apt update
sudo apt install nginx
sudo ufw app list

sudo ufw allow 'Nginx HTTP'
sudo ufw status
sudo systemctl status nginx
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl reload nginx

Nginx config for SPA

sudo nano /etc/nginx/sites-available/default
server {
  listen 80;
  listen [::]:80;
  root /var/www/html;
  location / {
    try_files $uri /index.html;  
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment