Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move redmine to a sub-URI with nginx as a proxy

I want to put redmine (listening on localhost:3000 standalone passenger) behind nginx, serving from http://domain.com/redmine with this simple nginx config:

server {
    location /redmine/ {                                                                                                                                                         
        proxy_pass      http://domain.com:3000/;
    }
}

I rewrote redmine's config/environments.rb based on the instructions from this HOWTO, and redmine properly rewrites static asset URLs, but controller URLS are not rewritten, for ex. settings point to http://domain.com/settings instead of http://domain.com/redmine/settings.

How can I properly configure redmine to run behind nginx?

like image 344
kissgyorgy Avatar asked Nov 19 '25 16:11

kissgyorgy


1 Answers

This is a pretty complicated thing to do. You wouldn't think so but it is. Every single redmine version that comes out has a different set of correct and incorrect ways of accomplishing this. For example, I have a working configuration with (nginx-1.4.1, unicorn, redmine-2.2.1) but now that I'm using (nginx-1.4.2, unicorn, redmine-2.3.3) that doesn't seem to work anymore. Here's some links that may be of use:

  • http://www.redmine.org/issues/11881
  • http://www.redmine.org/issues/12102
like image 52
ctrlc-root Avatar answered Nov 22 '25 06:11

ctrlc-root