Defect #2813

wrong hostname for atom-links

Added by Anton Dollmaier almost 13 years ago. Updated almost 11 years ago.

Status:ClosedStart date:2009-02-23
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:-
Resolution: Affected version:

Description

Hi,

Due to firewalling-issues I have redmine deployed on a machine which is only reachable via mod_proxy.

The hostnames are different, the mod_proxy-machine is reachable via "redmine.example.com", the real machine having redmine running via mongrel_cluster is connected via "redmine-int.example.com".

In the settings, I set the "hostname" to "redmine.example.com".

Using Redmine normally works great, except for RSS/Atom-links: Redmine does not use the "hostname"-setting for links to atom-pages, the link refs to "redmine-int.example.com":

<link href="http://redmine-int.example.com/projects/activity?format=atom&amp;key=MYATOMKEY" rel="alternate" title="ATOM" type="application/atom+xml" />

Changing the wrong hostname to the correct external hostname, the RSS/Atom is displayed correctly - only the link in the sourcecode is wrong.

In the view, the "auto_discovery_link_tag" is used, but I couldn't find the definition in the sourcecode (I don't code ruby).

Any help is appreciated.

additional information:

  • latest Redmine from 0.8-stable-Branch
  • Redmine-Machine: Debian Lenny with mongrel_cluster, installed via gem
  • Proxy: apache2.2 running on Mac

History

#1 Updated by Jean-Philippe Lang almost 13 years ago

Make sure you have this in your virtual host config:

ProxyPreserveHost On

#2 Updated by Anton Dollmaier almost 13 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

You're right, this solves the probleme.

But shouldn't the hostname-setting be in use, too?

This would be what I expect from a hostname-setting ...

Thanks!

#3 Updated by Jean-Philippe Lang almost 13 years ago

Actually, the hostname setting is only used to generate links in emails (which can be sent off-line and thus with no access to a 'host' of a request).
I'll add this to the FAQ.

#4 Updated by Greg Burri almost 13 years ago

In most cases the external hostname can't be preserved because the proxy access to a local address like localhost:8083 or 192.168.1.56.
Some documentation from Apache : http://httpd.apache.org/docs/2.0/mod/mod_proxy.html

Why the hostname setting can't be used for the atom stream ?

#5 Updated by Anton Dollmaier almost 13 years ago

Greg Burri wrote:

In most cases the external hostname can't be preserved because the proxy access to a local address like localhost:8083 or 192.168.1.56.

Actually, it works great:

You configure the proxy-vHost with the ProxyPreserveHost On-directive, proxypass to the internal address (localhost:8083 or else).

At this vhost you use ServerName redmine.external.domain or ServerAlias, redmine then works as expected.

#6 Updated by Jean-Baptiste Barth over 11 years ago

  • Status changed from Resolved to Closed

#7 Updated by staccatissimo Lee almost 11 years ago

Dear All,

Where could I put on this tag? --> ProxyPreserveHost On

Also available in: Atom PDF