Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to setup trac 1.0.1 behind an nginx reverse proxy. Trac is listening on port 8000 internally, and nginx should listen to port 80 on < ipadress >/trac.

I managed to setup nginx such that all requests are successfully forwarded to trac, however all links and images in trac are broken: all urls point to the main domain ( < ipadress > ), instead of to < ipadress >/trac.

This is the relevant part of my nginx.conf:

http {
    server {
        listen 80
        location /trac/ {
            proxy_pass http://localhost:8000/;
            proxy_set_header Host $host;

In my trac.ini I have also set the base_url parameter to http://<ipadress>/trac/ and use_base_url_for_redirect to True, but still all links are broken.

How can I setup nginx + trac such that trac is accessible via < ipaddres >/trac?

share|improve this question
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.