Unable to access InvenTree through existing Caddy reverse proxy #6794
Replies: 2 comments 2 replies
-
If you are redirecting to the Caddyfile at Your |
Beta Was this translation helpful? Give feedback.
-
@chris-thorn really getting into the limits of my knowledge of proxy configuration. Maybe you need to rewrite the host headers on your top-level proxy before sending through to the lower one? Maybe there is someone else who can comment with better insight. If there is something we can do to improve the default |
Beta Was this translation helpful? Give feedback.
-
I have a Caddy reverse proxy server running in a Docker container which forwards requests to other hosts on the network so I can access all my services through different subdomains, e.g. https://service1.example.com, https://service2.example.com. Ports 80 and 443 are forwarded to this host, which has IP address 192.168.0.20.
On another physical host I am running InvenTree using Docker Compose. The IP address of this host is 192.168.0.26. I had been running 0.13.6 without issue using the original nginx configuration, and this was accessible at https://inventree.example.com. On upgrading to 0.14.3 I decided to switch to the new Caddy configuration, but now when I visit https://inventree.example.com all I get is a blank page.
I have confirmed that I can access InvenTree at the IP address of the host on which it is running - in this case http://192.168.0.26. I have also confirmed that I can access this from the reverse proxy host by entering a shell in the reverse proxy Caddy container and running the command
curl -I http://192.168.0.26/accounts/login/?next=/
which returns status code 200 "OK". (I have also checked it without the-I
flag and it returns the correct HTML from the login page.) So I am confident that InvenTree is running and accessible.Looking at the Caddy logs on the reverse proxy, a request to https://inventree.example.com generates two entries:
Both long entries say
"Content-Length":["0"]
, so no data is being received, it seems.I've spent hours trying to debug this but I have to concede that I am stuck. If anyone can help I would be so grateful!
Files on InvenTree host
Compose file
Unchanged from https://github.com/inventree/InvenTree/blob/master/docker/docker-compose.yml, other than removing
version: "3.8"
, which I believe is deprecated from Compose v1.27 onwards, and changing the filename tocompose.yaml
.Caddyfile
Unchanged from https://github.com/inventree/InvenTree/blob/master/docker/Caddyfile
.env
Files on reverse proxy host
Top-level Caddyfile
import /srv/*.caddyfile
/srv/inventree.example.com.caddyfile
Result of command
docker compose logs
on InvenTree hostThis command was run straight after
docker compose down
anddocker compose up -d
and accessing https://inventree.example.com from a browser.Beta Was this translation helpful? Give feedback.
All reactions