Reverse Proxy with Trac

Michael Ching michaelc at wush.net
Sat Oct 25 06:44:30 MSD 2008


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