#3381 closed defect (worksforme)
base_url value in trac.ini seems broken
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | web frontend/tracd | Version: | 0.10b1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
maybe i'm wrong but the base_url value seems to be ignored after i've set it.
I want to have my trac wiki on https://someurl/trac/project/wiki
so i set the base_url to
https://someurl/trac/
i run my tracd with
/usr/bin/python /usr/bin/tracd -d --port 8000 -e /var/trac
and i have the following somewhere in my apache2 conf files:
ProxyPass /trac balancer://trac_cluster/
ProxyPassReverse /trac balancer://trac_cluster/
but non of the links get prefixed with this url…
i want apache to take care of the SSL and auth'ion stuff (apache doesn't seems to be the issue here)
Attachments (0)
Change History (5)
comment:1 by , 18 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
follow-up: 3 comment:2 by , 18 years ago
Milestone: | → 0.10 |
---|---|
Resolution: | worksforme |
Status: | closed → reopened |
Version: | 0.9.5 → 0.10b1 |
Why are the urls anyway absolute, why not use relative paths and try not to fix the problems caused by absolute paths with glue (base_url, base-path).
Anyway, the —base-path does not work either, if I enable it and try access the server I always get the project listing, even when not using trac trough proxy. I can see it requests /trac/project fine (even correct path) but it still returns project list …
comment:3 by , 18 years ago
Milestone: | 0.10 |
---|---|
Resolution: | → worksforme |
Status: | reopened → closed |
Replying to anonymous:
Why are the urls anyway absolute, why not use relative paths and try not to fix the problems caused by absolute paths with glue (base_url, base-path).
Relative URLs are used in the Trac HTML pages when possible, but RSS feeds and emails need to use absolute URLs.
Anyway, the —base-path does not work either, if I enable it and try access the server I always get the project listing, even when not using trac trough proxy. I can see it requests /trac/project fine (even correct path) but it still returns project list …
Please ask for help on the MailingList. Be sure to provide the tracd commandline and your configuration for the proxy.
comment:4 by , 18 years ago
I have a similar problem, but have traced the issue to the way relative URLs are re-contructed in source:/trunk/trac/web/api.py@4254#271
In there self.scheme is used, which comes from the wsgi request, and not from the base_url. So if you have a different scheme in your request, which happens when you are proxying behind Apache, the re-direct will seem to fail.
My solution is to temporarily hack in a hard-coded scheme in the source of the installation that I am using, but a more correct solution is obviously the better route.
Where are you looking for
base_url
to appear? It's only used when Trac needs to generate absolute URLs, such as in the RSS feeds. Otherwise Trac uses server-relative links.In order to use tracd through a proxy with a base URL other than "/" you'll need to upgrade to 0.10 (currently in the trunk) and use the
--base-path
option for tracd to properly parse the URLs coming from the proxy: