Skip to content

Instantly share code, notes, and snippets.

@ayxos
Created April 16, 2020 09:14
Show Gist options
  • Save ayxos/a75fa5b0e99bbb7778e46e5864b3e57e to your computer and use it in GitHub Desktop.
Save ayxos/a75fa5b0e99bbb7778e46e5864b3e57e to your computer and use it in GitHub Desktop.
Certbot process

Setting up new endpoints

  • go to "/etc/nginx/sites-available"
  • create a new file (with sudo)
  • copy this
server {
    server_name SUBDOMAIN_URL;

    location / {
            proxy_pass  NODE_APP;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
  • create new symlink sudo ln -s /etc/nginx/sites-available/prod /etc/nginx/sites-enabled/
  • create HTTPS certificate sudo certbot --nginx -d SUBDOMAIN_URL
  • restart nginx sudo systemctl restart nginx

*- renew certficates certbot renew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment