Ticket #231 (closed defect: invalid)
Wrong url mapping with FastCGI and lighttpd
| Reported by: | guest | Owned by: | jens |
|---|---|---|---|
| Priority: | minor | Milestone: | v0.9 |
| Component: | system | Keywords: | FastCGI lighttpd |
| Cc: | frank.tegtmeyer@… |
Description
It seems that the URL (back-)mapping is broken in some places when using FastCGI and lighttpd.
Here is my lighttpd setup (used also in other Django setups):
$HTTP["host"] =~ "(xxx.xxx.xxx)|(yyy.yyy.yyy)" {
server.document-root = "/media/internet/fake_documentroot/"
# aliases
alias.url = (
"/media/" => "/media/internet/media/",
"/admin/media/" => "/media/internet/django/contrib/admin/media/",
)
# rewrites
url.rewrite-once = (
"^(/media/.*)$" => "$1",
"^(/static/.*)$" => "$1",
"^(/internet.fcgi/.*)$" => "$1",
"^(.*)$" => "/internet.fcgi$1",
)
# FastCGI - Setup
#fastcgi.debug = 1
fastcgi.server = (
"/internet.fcgi" => (
(
"host" => "127.0.0.1",
"port" => 6978,
"check-local" => "disable",
),
)
)
}
There are two problems:
1. The script name (internet.fcgi) is used in front of generated links sometimes (that's why the rewrite-once rule is used for this).
Example in the django panel edit for a page:
<div id="user-tools">Willkommen, <strong>Frank</strong>. <a href="/internet.fcgi/_admin/doc/">Dokumentation</a> / <a href="/internet.fcgi/_admin/password_change/">Passwort ändern</a> / <a href="/internet.fcgi/_admin/logout/">Abmelden</a></div>
2. Some media links contain the physical path instead of the mapped URL.
Example in the django panel edit for a page:
<a href="../../../PyLucid/page/add/" class="add-another" id="add_id_parent" onclick="return showAddAnotherPopup(this);"> <img src="/media/internet/django/contrib/admin/media/img/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a>
The correct link to the image would be:
/admin/media/img/admin/icon_addlink.gif
I didn't do a complete check where this happens, sorry.
With kind regards,
Frank Tegtmeyer <frank.tegtmeyer@…>
Change History
Note: See
TracTickets for help on using
tickets.
