I want to set up utorrent with webui on my server.


Utorrent sets up its own webserver which, by default, listens on port 8080.

The ui is then accessed by accessing example.com:8080/gui

My goal is to have subdomain.server.com using reverse proxy.
The problem comes when I discovered that some urls are hard coded to /gui/* which of course breaks things.

I'm now trying to remove that initial /gui from the request using mod rewrite but for some reason it's not working.

I can access the site (I get the utorrent loading screen) but if I check my log I see that all requests to /gui/token.html get a 404 Not Found response, /token.html works just fine if I try it manually though.

I've tried moving the rewrite to the proxy but that doesn't work either.

What I have so far

Here is my virtual host file:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName subdomain.example.com

    RewriteEngine  on
    RewriteRule ^/gui(/?)(.*)$ /$2

    ProxyRequests off
    ProxyPass /
    ProxyPassReverse /
    RequestHeader set Authorization "Basic YWRtaW46"
    ErrorLog /var/log/apache2/utorrent-error.log
    CustomLog /var/log/apache2/utorrent-access.log common

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/*.domain.crt
    SSLCertificateKeyFile /etc/ssl/private/*.domain.key
    SSLCACertificateFile /etc/ssl/certs/domain-ca-ssl.crt

    BrowserMatch "MSIE [2-6]" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown


    Order deny,allow
    Deny from all
    Allow from all
    AuthName subdomain.example.com
    AuthType Basic
    AuthUserFile /etc/utorrent/.htpasswd
    Require valid-user

Turns out it was as simple as adding the [PT] flag to the rewrite


Worked like a charm with the PT switch added

<VirtualHost *:80>
        ServerName utorrent.yourdomain.com
        ProxyPreserveHost on
        RewriteEngine  on
        RewriteRule ^/gui(/?)(.*)$ /$2 [PT]
        ProxyPass /   
        ProxyPassReverse /   
  • Doesn't differ a single bit from the accepted answer. What gives? – Deer Hunter Apr 22 '15 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.