Having problem with reverse proxy (Apache on redmine server)

Added by Philip Dalrymple over 3 years ago

I am running redmine under puma with the setup as seen at the bottom of
this message. I am trying to get reverse proxy under Apache to work
with redmine. if I set the reverse proxy as follows:

## redmine on localhost
<Location /redmine>
        ProxyPreserveHost on
        ProxyPass http://localhost:9292
        ProxyPassReverse http://localhost:9292

I have set the config/environment.rb as follows:

# Initialize the Rails application
Redmine::Utils::relative_url_root = "/redmine" 

The pages render correctly with I put in for example:


and when I look at the source of the HTML I see that all of the
script and link elements correctly have the /redmine/... in them
the hrefs do not.

for example:

<script src="/redmine/javascripts/jquery-1.11.1-ui-1.11.0-ujs-4.3.1.js?1558011181"></script>
<script src="/redmine/javascripts/application.js?1558011533"></script>
<script src="/redmine/javascripts/responsive.js?1558011535"></script>

            <form action="/search" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />


        <div class="flyout-menu__avatar ">
                <a href="/users/5"><img alt="" title="" class="gravatar" srcset="//www.gravatar.com/avatar/f4537a8bb642a0e50642375754f93dd3?rating=PG&amp;size=160&amp;default=wavatar 2x" src="//www.gravatar.com/avatar/f4537a8bb642a0e50642375754f93dd3?rating=PG&amp;size=80&amp;default=wavatar" /></a>
            <a class="user active" href="/users/5">pwd</a>


I am new (first week) to redmine and to Ruby and Rails but do know Linux Postgers and Apache
not sure what I am missing here.
Server is Fedora release 29 (Twenty Nine)

with Postgers (from fedora package) of 10.7

Name : postgresql
Version : 10.7
Release : 1.fc29
Architecture: x86_64
Install Date: Mon 13 May 2019 10:06:08 AM EDT
Group : Applications/Databases
Size : 5816984
License : PostgreSQL
Signature : RSA/SHA256, Thu 21 Feb 2019 12:53:53 PM EST, Key ID a20aa56b429476b4
Source RPM : postgresql-10.7-1.fc29.src.rpm
Build Date : Mon 18 Feb 2019 05:12:16 AM EST
Build Host : buildhw-06.phx2.fedoraproject.org


Redmine 4.0.3.stable
Default administrator account changed
Attachments directory writable
Plugin assets directory writable (./public/plugin_assets)
RMagick available (optional)
ImageMagick convert available (optional)

Redmine version 4.0.3.stable
Ruby version 2.5.5-p157 (2019-03-15) [x86_64-linux]
Rails version
Environment production
Database adapter PostgreSQL
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery sendmail
Subversion 1.11.1
Mercurial 4.5.3
Bazaar 2.7.0
Git 2.20.1
Redmine plugins:
no plugin installed

Replies (2)

RE: Having problem with reverse proxy (Apache on redmine server) - Added by Philip Dalrymple over 3 years ago

OK I have tried a number of things and either get the server not running at all or
the same symptoms, i.e. the javascript and css havethe right links but the menus
all are missing the /redmine after the host part.

I have tried setting the enviormant RAILS_RELATIVE_URL_ROOT=/redmine
and in config/enviorment.rb all of the following

 # Initialize the Rails application
 ## relative_url_route works for javascript not for menu entries
 #Redmine::Utils::relative_url_root = "/redmine" 
 ## default_scope does not work for either
 #RedmineApp::Application.routes.default_scope = "/redmine" 
 ## ActionController:Base.relative_url_route again script right menus not
 #ActionController::Base.relative_url_root = "/redmine" 

All do the save thing except for ...default_scope which does not pub /redmine on anything

RE: Having problem with reverse proxy (Apache on redmine server) - Added by Michel Condemine almost 2 years ago

did you find a solution for this issue ?