How do I get https web interface in Transmission?

I use Transmission's Web Interface, but I don't feel comfortable using it remotely (outside of LAN, e.g., from a friend's house) due to the lack of any sort of encryption. The idea of broadcasting my Transmission Web Interface login details, wholly unencrypted, across the internet just doesn't appeal to me for some reason. (I'm kinda paranoid about that. I even installed a browser plugin to enable HTTPS on any site possible.)

I've heard of, and even attempted, a few of the convoluted tutorials involving lighttpd, but I haven't had any luck so far.

I just want to be able to use some sort of encryption for the Web Interface, so I can manage my torrents remotely. What do I need to do?


Solution 1:

I would recommend to install a simple web server such as nginx and make it proxy to port 8080, which would allow you to add authentication, SSL and other servers in the future if you would so please.

To configure nginx to forward things to 8080 you can write this in the /etc/nginx/sites-enabled/default file:

location / {
  proxy_pass        http://localhost:8080;
}

Keep in mind, that this will work only for the web interface and not if you want your torrent port to be 80.

To add SSL support you need to create a key and a signed certificate (I assume you don't want to have it signed by a CA, so here's how to self sign it):

openssl req -x509 -nodes -new -keyout <name>.key -out <name>.crt

The default server config file (same one as above) should have this contents:

server {
    listen 443 default_server ssl;
    ssl_certificate     /etc/nginx/test.crt;
    ssl_certificate_key /etc/nginx/test.key;
    server_name  default;

    access_log  /var/log/nginx/localhost.access.log;

    location / {
        proxy_pass        http://localhost:8080;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
            root   /var/www/nginx-default;
    }
}

You need to match the key and certificates locations to the ones you just created, and in your browser you will get an untrusted warning unless you import your certificate (or pay for a commercial one).

After making those changes in the config you should run:

sudo reload nginx

or

sudo /etc/init.d/nginx reload