Project

General

Profile

Reverse proxy and sub URI not working after update (site down)

Added by Steve G about 11 years ago

I finally decided to upgrade Redmine and in the process completely killed our reverse-proxy/URi setup.

When going to the site www.notrealdomain.com/prj/ I get the front page fully loaded. however ALL the links (like login..) show www.notrealdomain.com/login which obviously doesn't exist on the reverse-proxy so I get an error page from the reverse-proxy.

Let me stress again that this worked flawlessly for the past 2 years until the upgrade from 1.2.1 to latest stable.

our setup:
Reverse-proxy using apache2 with the following:

ProxyPass       /prj/   http://prj.someinternaldomain.com/
<Location /prj/>
        ProxyPassReverse /
        RequestHeader unset Accept_Encoding
</Location>

I did try changing the proxypassreverse to /prj with no success.

web server with Redmine where a number of edits were made to handle the URi and reverse proxy:

<VirtualHost *:80>
    ServerAdmin info@
    DocumentRoot /data/web/prj/public
    ServerName prj.someinternaldomain.com
    ErrorLog logs/prj-error_log
    CustomLog logs/prj-access_log common
        RailsBaseURI /prj                          (this wasn't here before upgrade, this is yet another attempt at fixing this problem)
        <Directory /data/web/prj/public>
                Options Indexes ExecCGI FollowSymlinks
                Allow from all
                AllowOverride all
                Options -MultiViews
        </Directory>
</VirtualHost>

Originally had the following in the environment.rb file:

Redmine::Utils::relative_url_root = "/prj" 

discovered it was deprecated and attempted a bunch of different solutions such as the following:

config.action_controller.relative_url_root = '/prj' (in additional_environment.rb)
routes.default_url_options = {:script_name => '/prj'} (in application.rb)
and a bunch more based on bug reports, recommendations and a whole lot of googling.

So... how can I fix this mess?
I was able to reactivate the old site but now only the admin account can access the actual issues/bugs etc.. so the thing is down and I probably have 24 hours before this becomes a major issue.
I tried recovering the database to roll back to the old site but that broke things even further so right now I have a system that only the admin user can use. Not good.

help needed and truly appreciated!!


Replies (5)

RE: Reverse proxy and sub URI not working after update (site down) - Added by Ivan Cenov about 11 years ago

See this description: https://hawkflyers.wordpress.com/2011/12/24/installation-guide-of-redmine-on-windows-system/
It is for Redmine 1.3.x, too old one. Nevertheless, see the part for Apache reverse proxy configuration. It could give you some ideas for what to do... (it works for Redmine 2.2.3/thin/ruby 1.9.3/Windows).

HTH,
Ivan Cenov

RE: Reverse proxy and sub URI not working after update (site down) - Added by Pavel Potcheptsov about 11 years ago

Hello, I suggest you to you nginx as front-end and unicorn or thin as ruby back-end.
This is most stable and easy configuration.
As I know, you can't use database for previous RM version after mirgate to new one.
You should always did and save backup of old database before migrate.

RE: Reverse proxy and sub URI not working after update (site down) - Added by Steve G about 11 years ago

Thanks guys for the thoughts.

Ivan, the issue is that this version is too old it uses the same command to change the URi that I used to and it no longer works (Redmine::Utils::relative_url_root = "/prj")

hence my problem. We use Apache/Passenger if that helps any (on CentOS).

Pavel, I can't replace Apache at all, it's being used as a reverse proxy with some custom code for other applications.

thinking through it I really don't think the problem is with the reverse-proxy but JUST with the change of URi not working with new Rails/Redmine.

Thoughts?

RE: Reverse proxy and sub URI not working after update (site down) - Added by Martin Dubé about 11 years ago

Hi,

If I remember correctly, I had to change the RailsBaseURI directive to RackBaseURI some time ago when updating redmine (I don't recall version numbers).

If that can help, here is my setup for proxy (which I don't use anymore):

Proxy side:

ProxyPass /redmine https://192.168.0.151/redmine
<Location /redmine>
   ProxyPassReverse https://192.168.0.151/redmine
</Location>

Redmine server side:

Alias /redmine    /srv/www/htdocs/redmine
   <Directory /srv/www/htdocs/redmine>
      #RailsBaseURI /redmine
      # Require SSL connection for password protection.
      SSLRequireSSL
      RackBaseURI /redmine
      AllowOverride all
      Options -MultiViews
      Allow from all
   </Directory>

RE: Reverse proxy and sub URI not working after update (site down) - Added by David Ohsie about 11 years ago

I don't know enough about ruby, rails or redmine to fix your problem. However, as a stopgap, you could consider using mod_proxy_html to have apache rewrite the links coming back in your redmine html until you can fix the real problem. I would include a link to the help page for mod_proxy_html, but my response is then rejected as spam.

    (1-5/5)