Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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

My goal is to have 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>

    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
    AuthType Basic
    AuthUserFile /etc/utorrent/.htpasswd
    Require valid-user
share|improve this question
up vote 1 down vote accepted

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

share|improve this answer

Worked like a charm with the PT switch added

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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