route links don't work when using gunicorn wsgi and URL prefixes

12 views
Skip to first unread message

Davidiam

unread,
Jun 24, 2026, 4:30:59 AM (10 days ago) Jun 24
to py4web
Our setup is as follows:
Webseal/Apache reverse proxy (multiple location blocks)/gunicon and custom wsgi

As we are working with multiple location blocks in our Apache reverse proxy config, we need to use URL prefixes.  These prefixes are defined as SCRIPT_NAME in our custom wsgi.

We have managed to get everything working except for dbadmin/grid.py (discussed in another post)
and the routing links in the _dashboard application.

The links are generated in the _dashboard/templates/index.html and they do not take the prefix or SCRIPT_NAME into account as they use absolute paths by default.

If they are converted to relative paths, then they are the prefixed first by _dashboard/static before the script_name prefix is applied.

This is the work_around which all of our customers need to apply to index.html:

Search for this line:

<td><a v-bind:href="route.rule" target="_blank"><tt>{{route.rule}}</tt></a></td>

and replace it with this line:


<td><a v-bind:href="'../../' + route.rule.replace(/^\/+/, '')" target="_blank"><tt>{{route.rule}}</tt></a></td>

My question is: Is there a cleaner way to fix this in py4web?
Reply all
Reply to author
Forward
0 new messages