Repository navigation
Description
Please verify that this bug has NOT been raised before.
- I checked and didn't find a similar issue
Describe the bug*
#10900 introduced a new feature to modify the inventree server bind URL. For my setup this change was breaking and I wanted to ask whether this is something that should be fixed or something that should be ignored and the server admin is responsible for in your opinion.
Steps to Reproduce
I am using the standard docker-compose setup and changed the INVENTREE_WEB_PORT to 8080 because my InvenTree runs behind a separate proxy that handles TLS. With the new change, the InvenTree Server recognizes the variable to listen on port 8080, but my reverse proxy still proxies to the static 8080 port as this directive in the caddyfile ensures:
reverse_proxy {$INVENTREE_SERVER:"http://inventree-server:8000"}Using the default setup and changing the INVENTREE_WEB_PORT to 8080 should be sufficient to produce a bad gateway error
Expected behaviour
I would expect that the reverse proxy also adapts to the new INVENTREE_WEB_PORT value.
Since caddy does not support nesting variable substitions (to my knowledge), I could not simply define
reverse_proxy {$INVENTREE_SERVER:"http://inventree-server:${INVENTREE_WEB_PORT:-8000}"}as this leads to a syntax error.
My workaround was to use the following in my .env file:
INVENTREE_WEB_PORT=8080
INVENTREE_SERVER=http://inventree-server:${INVENTREE_WEB_PORT}Now this is not a big deal for admins, just something to be aware of. Is it worth considering a fix in the setup? Or is it simply the server admins responsibility?
Deployment Method
Docker
Version Information
v1.2.0
Try to reproduce on the demo site
I did not try to reproduce
Is the bug reproducible on the demo site?
Not reproducible
Activity
SchrodingersGat commentedon Feb 16, 2026
The provided setup files do not provide (and cannot provide) a one-size-fits-all solution. I think that this is fine and not a "bug" - the server admin can easily edit the file as needed, and overwrite the placeholders.
p-fruck commentedon Feb 16, 2026
Fine more me, thanks for the reply 👍
matmair commentedon Feb 17, 2026
@p-fruck would this help? #11352
p-fruck commentedon Feb 17, 2026
@matmair this results in the following error for me:
As mentioned in the issue description, I don't think caddy supports nested variables. We could however fix the default behavior using docker-compose if we add the following:
Only the
environmentsection is new. This way we would ensure caddy still works when theINVENTREE_WEB_PORTis changed. Since the.envfile takes precendence, theINVENTREE_SERVERvariable can still be overridden using.env.Still, I would like to leave the decision up to you whether you want to handle this special case or just delegate the responsibility to the server admins :)
gid204 commentedon Feb 17, 2026
Thanks for this, I already had
INVENTREE_WEB_PORT=8080in my .env but addingINVENTREE_SERVER=http://inventree-server:${INVENTREE_WEB_PORT}has fixed the issue for me.Is someone able to explain what this line is actually doing and why it resolves the issue?
p-fruck commentedon Feb 17, 2026
I think this issue already explains it?
http://inventree-server:8000or${INVENTREE_SERVER}if this variable is defined (by default it isn't)8000by defaultINVENTREE_WEB_PORTif defined (instead of 8000)http://inventree-server:8000(nothing is running on this port however)INVENTREE_SERVER=http://inventree-server:${INVENTREE_WEB_PORT}you simply tell the reverse proxy to dynamically adapt to theINVENTREE_WEB_PORT