Need help configuring a rails app (redmine)

Hi,

I’m trying to configure nginx to be able to use redmine at
http://myurl.ca/redmine and I can’t figure out how to do it. After
trying things for a few hours, I put my config over at port 81 and it’s
working correctly. Heres what I have :

upstream mongrel {
server 127.0.0.1:9000;
server 127.0.0.1:9001;
}

server {
listen 81;
server_name myurl.ca;
server_tokens off;

            root /path/to/root/redmine/public;

            location / {
                    proxy_set_header  X-Real-IP  $remote_addr;
                    proxy_set_header  X-Forwarded-For

$proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
proxy_read_timeout 300;

                    if (-f $request_filename/index.html) {
                            rewrite (.*) $1/index.html break;
                    }

                    if (-f $request_filename.html) {
                            rewrite (.*) $1.html break;
                    }

                    if (-f $request_filename.txt) {
                            rewrite (.*) $1.txt break;
                    }

                    proxy_pass http://mongrel/;
            }
    }

The problem is that my boss can’t access port 81 :/.
So, I copied this config into a “location ^~ /redmine/ {” directive into
my server directive using the port 80. The problem is that images/css
and links points to myurl.ca instead of myurl.ca/redmine. Tried
everything, but can’t figure out what I have to change.

Any idea ?