netbox-docker/docker/nginx-unit.json
Tobias Genannt afd18c6f39 Fixes #1331: Added 'forwarded' section Unit config
Simplifies the listener configuration by using a wildcard for the IP and
adds a forwarded section that trusts all proxies on RFC1918 networks.
2024-11-05 13:20:04 +01:00

62 lines
1.2 KiB
JSON

{
"listeners": {
"*:8080": {
"pass": "routes/main",
"forwarded": {
"client_ip": "X-Forwarded-For",
"protocol": "X-Forwarded-Proto",
"source": ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
}
},
"*:8081": {
"pass": "routes/status",
"forwarded": {
"client_ip": "X-Forwarded-For",
"protocol": "X-Forwarded-Proto",
"source": ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
}
}
},
"routes": {
"main": [
{
"match": {
"uri": "/static/*"
},
"action": {
"share": "/opt/netbox/netbox${uri}"
}
},
{
"action": {
"pass": "applications/netbox"
}
}
],
"status": [
{
"match": {
"uri": "/status/*"
},
"action": {
"proxy": "http://unix:/opt/unit/unit.sock"
}
}
]
},
"applications": {
"netbox": {
"type": "python 3",
"path": "/opt/netbox/netbox/",
"module": "netbox.wsgi",
"home": "/opt/netbox/venv",
"processes": {
"max": 4,
"spare": 1,
"idle_timeout": 120
}
}
},
"access_log": "/dev/stdout"
}