https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292013-02-04T14:05:20ZRedmineRedmine - Defect #13077: redirect to wrong back_url behind Apache reverse proxyhttps://www.redmine.org/issues/13077?journal_id=452582013-02-04T14:05:20ZMathias Walter
<ul></ul><p>The internal web server was used and redmine was started with <code>./script/rails server -e production</code></p>
<p>log entry:</p>
<pre>
Started GET "/" for xxx.xxx.xxx.xxx at 2013-02-04 15:02:33 +0100
Processing by WelcomeController#index as HTML
Current user: anonymous
Redirected to http://subdomain.domain.tld/login?back_url=http%3A%2F%2Fsubdomain.domain.tld%2F
Filter chain halted as :check_if_login_required rendered or redirected
Completed 302 Found in 6ms (ActiveRecord: 1.5ms)
</pre> Redmine - Defect #13077: redirect to wrong back_url behind Apache reverse proxyhttps://www.redmine.org/issues/13077?journal_id=454422013-02-08T09:38:44ZMathias Walter
<ul></ul><p>I've updated from Redmine 1.2, not from 1.4.</p> Redmine - Defect #13077: redirect to wrong back_url behind Apache reverse proxyhttps://www.redmine.org/issues/13077?journal_id=454432013-02-08T09:52:33ZEtienne Massip
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Priority</strong> changed from <i>Urgent</i> to <i>Normal</i></li><li><strong>Resolution</strong> set to <i>Invalid</i></li></ul><p>This is mostly support request, neither a bug or feature request.</p>
<p>Configuring Redmine on a relative root is a bit tricky with Redmine 2.x and you have to define a scope for routes.</p>
<p>Basically, adding <code>RedmineApp::Application.routes.default_scope = '/redmine'</code> should help you, see <a class="issue tracker-1 status-1 priority-4 priority-default" title="Defect: Installed Redmine in a sub-URI: Links are generated not correctly (New)" href="https://www.redmine.org/issues/12102#note-1">#12102#note-1</a>.</p> Redmine - Defect #13077: redirect to wrong back_url behind Apache reverse proxyhttps://www.redmine.org/issues/13077?journal_id=454462013-02-08T11:59:10ZMathias Walter
<ul></ul><a name="Just-for-the-records"></a>
<h3 >Just for the records:<a href="#Just-for-the-records" class="wiki-anchor">¶</a></h3>
<p>Since I didn't get it to work with the internal Webrick server (even if I set <code>RedmineApp::Application.routes.default_scope</code>), I switched to Thin and changed the configuration according to Teddy's comment (<a class="issue tracker-1 status-1 priority-4 priority-default" title="Defect: Installed Redmine in a sub-URI: Links are generated not correctly (New)" href="https://www.redmine.org/issues/12102#note-12">#12102-12</a>) and with <code>config.asset_path = '/redmine%s'</code>.</p>
<p>Then I gave Puma a try. Unfortunately, Puma does not support a <code>prefix</code> parameter. Hence I changed the <code>config.ru</code> according to <a class="issue tracker-1 status-1 priority-4 priority-default" title="Defect: Installed Redmine in a sub-URI: Links are generated not correctly (New)" href="https://www.redmine.org/issues/12102#note-13">#12102-13</a>.</p>
<p>Now it works like a charm.</p>
<p>The wiki document <a class="wiki-page" href="https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI">HowTo_Install_Redmine_in_a_sub-URI</a> whould be updated to Redmine 2.x configuration.</p> Redmine - Defect #13077: redirect to wrong back_url behind Apache reverse proxyhttps://www.redmine.org/issues/13077?journal_id=497632013-05-30T16:46:40ZAnonymous
<ul></ul><p>I had the same problem. To reproduce this:</p>
<ol>
<li>Sign in</li>
<li>Click the sign out. This should produce a URL like this: <a class="external" href="http://domain.tld/login?back_url=http%253A%252F%252Fdomain.tld%252F">http://domain.tld/login?back_url=http%253A%252F%252Fdomain.tld%252F</a>
<ol>
<li>Notice that the back_url is essentially escaped twice.</li>
</ol>
</li>
<li>Sign in again. You are now authenticated according to the logs but the redirect fails and you don't go anywhere</li>
<li>Refreshing the page brings you to the default page (my_page_path)</li>
</ol>
<p>A simple fix for this was to unescape twice the back url in ApplicationController::redirect_back_or_default. Change<br /><code>back_url = params[:back_url].to_s</code><br />to<br /><code>back_url = CGI.unescape(CGI.unescape(params[:back_url].to_s))</code></p> Redmine - Defect #13077: redirect to wrong back_url behind Apache reverse proxyhttps://www.redmine.org/issues/13077?journal_id=558662014-04-14T04:19:38ZRyan J
<ul></ul><p>This is possibly an Apache issue. I have no idea how to make it work properly though.</p>
<p><a href="https://confluence.atlassian.com/display/BAMKB/404+page+as+a+result+of+double-encoded+slashes+in+the+URL+when+using+Apache" class="external">Explanation from Atlassian</a><br /><a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=39746" class="external">Possibly related Apache bug</a></p> Redmine - Defect #13077: redirect to wrong back_url behind Apache reverse proxyhttps://www.redmine.org/issues/13077?journal_id=835432018-02-13T10:28:02ZAleksandar Pavic
<ul></ul><p>This is still issue, I am on Redmine 3.4 configured running behind IIS as reverse proxy, on PUMA...</p>