# Need help configuring a rails app (redmine)

**URL:** <https://www.ruby-forum.com/t/need-help-configuring-a-rails-app-redmine/160924>\
**Category:** NGINX\
**Created:** [February 21, 2009, 12:00am UTC](https://www.ruby-forum.com/t/need-help-configuring-a-rails-app-redmine/160924 "2009-02-21T00:00:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pelletiermaxime](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c57346/32.png) [@pelletiermaxime](https://www.ruby-forum.com/u/pelletiermaxime)\
**Post date:** [February 21, 2009, 12:00am UTC](https://www.ruby-forum.com/t/need-help-configuring-a-rails-app-redmine/160924/1 "2009-02-21T00:00:46Z")

</div>

Hi,

I’m trying to configure nginx to be able to use redmine at  
[http://myurl.ca/redmine](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 ?
