Version 1.0.0 behind Traefik reverse proxy does not serve static files #437
Replies: 8 comments 10 replies
-
And I found oout what is happening. The section in nginx-unit.json appends the BASE_PATH to the share statement. Using BASE_PATH=netbox and a nginx-unit.json config with below works: "routes": [ How on earth do i get nginx unit not to behave like that? We use various URLs and base paths http://server/ipam-dev, http://server/ipam-test ,http://server/ipam-prod) etc, and was very simple with the old nginx.conf as a docker config for each instance. Cant find to set Unit to use a specific directory |
Beta Was this translation helpful? Give feedback.
-
FYI, I ended up with adding a Traefik rule n my deployment, so that I still use ngninx and a shared static folder. Only solution I found to the issue |
Beta Was this translation helpful? Give feedback.
-
FYI i'm struggling with the exact same issue. Running netbox-docker behind a reverse proxy with URL test123.org.local/netbox. Setting the BASE_PATH does not work and results in a static media failure. After manually adjusting the nginx-unit.json file in the container i'm unable to fix the situation. I guess i'll revert back to 0.27 but this is a real shame. If any of the maintainers need extra information in regards to configuration or logs etc i would happy to assist. I'm not that confident with nginx-unit files so its a bit difficult for me to make a final solution. |
Beta Was this translation helpful? Give feedback.
-
We actually just faced the same issue and found a pretty simple solution: In
After nginx is removed you have 2 endpoints which traefik is loadbalancing to: the netbox container and the netbox-worker container. These both however are constructed from a template and your traefik rules are applied to both of them resulting in both of them to be targeted by traefik, while only the netbox container serves the files. Disabling trafik and thus overriding the templated rules directs all traffic to the netbox container and things work like expected. |
Beta Was this translation helpful? Give feedback.
-
Did anyone succeed with this? The suggestion to disable traefik did nothing. I never got it working, and with the latest 1.4 version I'm unable to use a shared volume for static files as the required user 101 have no write permissions on my NFS volume. This Unit stuff stinks big time |
Beta Was this translation helpful? Give feedback.
-
I'm also getting the same issue, but I'm proxying it with a subdomain, rather than a path, and I get the same issue. Although, according to the network tab in Chrome, two of the static assets load, and then the rest timeout with a 504. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
I ran into this as well today. The problem is that the django application is aware of I would think changing nginx-unit config to include the desired path prefix in the static route would also work. |
Beta Was this translation helpful? Give feedback.
-
FWIW this is also discussed in #650 with similar resolution / workaround options. |
Beta Was this translation helpful? Give feedback.
-
Trying to get the new version running behind Traefik on Docker, where i use http://server/ipam/ url for Netbox
Now, in earlier versions, I had a nginx.conf with adoption to the BASE_PATH=ipam/ in Netbox ENV
Since nginx is removed i favor for nginx-unit, i suspect there is some config issue on my side. Anyone that have done 1.0 behind Traefik?
Beta Was this translation helpful? Give feedback.
All reactions