I’ve got these in the log file on odoo nginx proxy:
connect() failed (111: Connection refused) while connecting to upstream, client: 8**.**.**.***, server: bit ****.dns.org, request: "GET /websocket HTTP/1.1", upstream: "http://127.0.0.1:8072/websocket", host: "www.bit***.dns.org"
root@bi:/var/log/nginx#
Another error when I tried to access
"GET /websocket HTTP/1.1" 502 575
I needed to change /etc/hosts
form : #127.0.0.1 localhost
to 127.0.0.1 bit****.dns.org
Becouse i need to get a certificate with certbot.
My configuration on nginx is
# Odoo Upstreams
upstream odooserver {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
location /websocket {
proxy_redirect off;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
#added 95-a 98
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://odoochat;
}
Why connect() failed (111: Connection refused) ?
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
The 502 is a generic error that just informs you that the proxy serivce is unable to connect to your backend service.
The first thing to check is whether the Odoo service, specifically the WebSocket service, is running on port 8072
. You can verify this by using the following command:
sudo netstat -tuln | grep 8072
If the service is not running, you may need to start or restart the Odoo service:
sudo systemctl restart odoo
Ensure that the configuration file for Odoo (odoo.conf
) has the correct port settings and that the WebSocket service is enabled.
Let me know how it goes!
- Bobby
Heya,
The error connect() failed (111: Connection refused) while connecting to upstream
is not connected to Nginx.
The error suggest an issue with the application rather than your WebService. What I’ll recommend is to check your application’s error log. You’ll see the exact error there, it will for sure be connected to your App in someway.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.