Assume your deployment is under /netbox
:
Add to configuration/configuration.py
BASE_PATH = environ.get('BASE_PATH', '')
Add to env/netbox.env
BASE_PATH=/netbox
Then merge this with your own docker-compose.override.yml
(or create one if not existed) to make health checker of Docker happy:
version: '3.4'
services:
netbox:
healthcheck:
test: "curl -f http://localhost:8080/netbox/api/ || exit 1"
Outside NGINX config:
upstream netbox {
server 127.0.0.1:8080; # or your own NetBox port
}
server {
listen 80;
location /netbox {
proxy_pass http://netbox;
}
location /netbox/static {
proxy_pass http://netbox/static/;
}
}
The trick is to strip BASE_PATH
on any requests to static resources.