Reverse Proxy with Trac

Mario Gazzo mario.gazzo at gmail.com
Mon Oct 27 13:24:50 MSK 2008


Thanks for the tip. Seems that the base_url needs to be absolute in  
order for this to work and I am not sure whether I would like to have  
this in my trac.ini. I also found an alternative solution where the  
new relative path is set inside Apache but this obviously requires  
that Trac is run from Apache instead of the standalone Trac daemon.  
This is not a problem for me since I will anyway be running other  
stuff with Apache. The only problem with this solution is that in case  
of a change I will have to change the path in multiple places (NGINX  
and Apache conf).

I appreciate the support. Thanks a lot.

Cheers
Mario

On 25/10/2008, at 04.44, Michael Ching wrote:

> Mario Gazzo wrote:
>> Thanks for the reply but I did not explain myself very well. There  
>> is no "/trac" subdirectory on the Trac server. The "/trac"  
>> subdirectory is the path that I want to access trac with from the  
>> outside through NGINX, which means the external URL becomes "http://dev.mytestdom.dk/trac 
>> ". The internal trac url is still http://192.168.0.187:8000/ and  
>> when it returns the page all relative links needs to be have "/ 
>> trac" prepended in order to work with the external address. E.g.  
>> The internal address of a trac-page "http://192.168.0.187:8000/ 
>> mypage" becomes "http://dev.mytestdom.dk/trac/mypage" when accessed  
>> from outside.
> If I remember correctly, the relative links should work, but the  
> redirects would be giving you problems.  In your trac.ini, if you  
> set the base_url parameter to the external url and then enable the  
> use_base_url_for_redirect setting it should handle this correctly  
> (see http://trac.edgewall.org/wiki/TracIni).   I believe this is  
> also needed for the RSS feeds to work properly behind a proxy.






More information about the nginx mailing list