Reverse Proxy with Trac

Michael Ching michaelc at
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 
> "". The internal trac url is still 
> 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 
> "" becomes 
> "" 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   I believe this is also needed 
for the RSS feeds to work properly behind a proxy.  

More information about the nginx mailing list