In /etc/nginx/sites-enabled
/etc/nginx/sites-enabled
sub.domain.com
server { server_name sub.domain.com; location / { proxy_pass http://localhost:PORT; } }
Then generate certificate with certbot
certbot