[BUG] 502 Bad Gateway when trying to access WebUI (Docker)
See original GitHub issueHi,
I’m trying to install InvenTree since this morning with docker (Unraid Server), On Unraid, we don’t have the docker compose, so I created two dockers, one containing InvenTree and another containing the Nginx, both are in bridge access. InvenTree was installed without too much difficulty however no way to access the web interface, I get a 502 error and the Nginx logs indicate: "[error] 31#31: *2 connect() failed (111: Connection refused) while connecting to upstream"
Concerning the docker :
- InvenTree

- Nginx

I’ve used the Nginx conf files given on the repo : server { # Listen for connection on (internal) port 80 listen 80; server_name 192.168.0.50; location / { # Change ‘inventree-server’ to the name of the inventree server container, # and ‘8000’ to the INVENTREE_WEB_PORT (if not default) proxy_pass http://192.168.0.50:8181;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
client_max_body_size 100M;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
}
# Redirect any requests for static files
location /static/ {
alias /var/www/static/;
autoindex on;
# Caching settings
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
# Redirect any requests for media files
location /media/ {
alias /var/www/media/;
# Media files require user authentication
auth_request /auth;
}
# Use the 'user' API endpoint for auth
location /auth {
internal;
proxy_pass http://192.168.0.50:8181/auth/;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
}
Logs for the InvenTree Docker Starting :
`"Starting background tasks… Loading action plugins… Discovered 1 action plugins: 13:23:07 [Q] INFO Q Cluster four-east-wisconsin-pennsylvania starting. 13:23:07 [Q] INFO Process-1:1 ready for work at 18 13:23:07 [Q] INFO Process-1:2 ready for work at 19 13:23:07 [Q] INFO Process-1:3 ready for work at 20 13:23:07 [Q] INFO Process-1:4 ready for work at 21 13:23:07 [Q] INFO Process-1:5 monitoring at 22 13:23:07 [Q] INFO Process-1 guarding cluster four-east-wisconsin-pennsylvania 13:23:07 [Q] INFO Q Cluster four-east-wisconsin-pennsylvania running. 13:23:07 [Q] INFO Process-1:6 pushing tasks at 23 13:23:36 [Q] INFO Enqueued 1 13:23:36 [Q] INFO Process-1 created a task from schedule [InvenTree.tasks.delete_successful_tasks] 13:23:36 [Q] INFO Enqueued 2 13:23:36 [Q] INFO Process-1 created a task from schedule [InvenTree.tasks.check_for_updates] 13:23:36 [Q] INFO Enqueued 3 13:23:36 [Q] INFO Process-1 created a task from schedule [InvenTree.tasks.heartbeat] 13:23:36 [Q] INFO Enqueued 4 13:23:36 [Q] INFO Process-1 created a task from schedule [InvenTree.tasks.update_exchange_rates] 13:23:36 [Q] INFO Enqueued 5 13:23:36 [Q] INFO Process-1 created a task from schedule [InvenTree.tasks.delete_expired_sessions] 13:23:36 [Q] INFO Enqueued 6 13:23:36 [Q] INFO Process-1 created a task from schedule [stock.tasks.delete_old_stock_items] 13:23:36 [Q] INFO Process-1:1 processing [grey-dakota-two-hamper] 13:23:36 [Q] INFO Process-1:2 processing [floor-snake-papa-cold] 13:23:36 [Q] INFO Process-1:3 processing [red-floor-louisiana-mississippi] 13:23:36 [Q] INFO Process-1:4 processing [hawaii-sodium-lima-ten] Could not perform heartbeat task - App registry not ready 13:23:36 [Q] INFO Process-1:3 processing [low-music-undress-magnesium] 13:23:36 [Q] INFO Process-1:1 processing [virginia-pennsylvania-seventeen-yankee] Deleting 0 expired sessions. Updating exchange rates from https://api.exchangerate.host/latest Using base currency ‘USD’ 13:23:36 [Q] INFO Processed [red-floor-louisiana-mississippi] 13:23:36 [Q] INFO Processed [grey-dakota-two-hamper] 13:23:36 [Q] INFO Processed [low-music-undress-magnesium] 13:23:36 [Q] INFO Processed [virginia-pennsylvania-seventeen-yankee] Latest InvenTree version: ‘0.5.4’
13:23:37 [Q] INFO Processed [floor-snake-papa-cold] 13:23:37 [Q] INFO Processed [hawaii-sodium-lima-ten] 13:35:08 [Q] INFO Enqueued 7 13:35:08 [Q] INFO Process-1 created a task from schedule [InvenTree.tasks.heartbeat] 13:35:08 [Q] INFO Process-1:3 processing [six-utah-sodium-seven] Could not perform heartbeat task - App registry not ready 13:35:08 [Q] INFO Processed [six-utah-sodium-seven]"`
Deployment Method
- Docker on Unraid Server
Thanks for Your Help !
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Related StackOverflow Question
Yes, I think so 😃 I will try the system tomorrow, I hope it will work like a charm, for now I’m translating InvenTree in French on crowdin because no one has done it lol !
I have a caddy server, I will put the instance behind it, I also have a CloudFlare plan over the Caddy, so I suppose it will be ok, I was just woried about security and stability concerning the docker and if it must run obligatory behind Nginx or not. Many Thanks for your help guys 👍