Server {
Root /var/www/example.com;
Index index.html;

Server_name example.com;

Location /transmission {
Proxy_pass http://localhost:9091/;
}

Location / {
Try_files $uri $uri/ =404;
}

Listen 443 ssl; # managed by certbot

Ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by certbot
Ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by certbot
Include /etc/letsencrypt/options-ssl-nginx.conf; # managed by certbot
Ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by certbot

}
Server {
If ($host = example.com) {
Return 301 https://$host$request_uri;
} # managed by certbot

Server_name example.com;
Listen 80;
Return 404; # managed by certbot
}