server { server_name trac.example.com; access_log /data/log/nginx/trac-access.log; error_log /data/log/nginx/trac-error.log; client_max_body_size 20M; location / { proxy_pass http://localhost:8000/; include proxy_params; } location ~ chrome/common { root /usr/local/lib/python2.7/dist-packages/trac/htdocs; rewrite /([^/]+)/chrome/common/(.*) /$2 break; expires 4w; } location ~ chrome/site { root /data/trac; rewrite /([^/]+)/chrome/site/(.*) /$1/htdocs/$2 break; expires 1d; autoindex on; } }