Skip to content

Commit 7ced80a

Browse files
committed
Support BASE_PATH setting in netbox
Map the static files correctly when netbox is served from a specific BASE_PATH.
1 parent 4979c55 commit 7ced80a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/uwsgi.ini.j2

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ processes={{ netbox_processes }}
88
module=netbox.wsgi
99
virtualenv={{ netbox_virtualenv_path }}
1010
chdir={{ netbox_current_path }}/netbox
11-
static-map=/static={{ netbox_current_path }}/netbox/static
11+
{% if netbox_config.BASE_PATH is defined %}
12+
{% set _base_path = netbox_config.BASE_PATH.strip('/') ~ '/' %}
13+
{% else %}
14+
{% set _base_path = '' %}
15+
{% endif %}
16+
static-map=/{{ _base_path }}static={{ netbox_current_path }}/netbox/static
1217
logger={{ netbox_application_log }}
1318
req-logger={{ netbox_requests_log }}
1419

0 commit comments

Comments
 (0)