Odoo Help


111: Connection refused error - Nginx SSL Config for Odoo Android App

Marcio Ribeiro
on 11/16/16, 8:48 AM 2,341 views

Previously I had a simple proxy configuration in my Odoo 10 Installation, only adding the Nginx layer to the webservice, by following  this guide: https://www.linuxhelp.com/how-to-setup-openerp-odoo-9-uisng-nginx-in-linux/.

A week later, I followed this tutorial to create a Digital Certificate, and use the HTTPS port properly: http://www.schenkels.nl/2014/12/reverse-proxy-with-odoo-8-nginx-ubuntu-14-04-lts/.

And to avoid any conflict I also removed the previous Nginx config file created by the first guide.

Everything works fine on the Web App. 

Unfortunatly I can't connect anymore to the Android App configured to my server. The app shows a white screen, and I get the following Nginx error: 

2016/11/16 12:57:31 [error] 3615#3615: *2 connect() failed (111: Connection refused) while connecting to upstream, client: smartphone_ip_trying_con, server: myhost, request: "POST /web/webclient/version_info HTTP/1.1", upstream: "", host: "myhost", referrer: "https://myhost/web".

And this is my Nginx config file.:

upstream odoo10 {server weight=1 fail_timeout=0;
upstream odoo10-im {server weight=1 fail_timeout=0;
## http redirects to https ##server {listen 80;
server_name myhost;
# Strict Transport Securityadd_header Strict-Transport-Security max-age=2592000;
rewrite ^/.*$ https://$host$request_uri? permanent;
server {# server port and namelisten 443 ssl;
server_name myhost;
# Specifies the maximum accepted body size of a client request,# as indicated by the request header Content-Length.
client_max_body_size 200m;
# add ssl specific settingskeepalive_timeout 60;
ssl on;
ssl_certificate /etc/ssl/nginx/myhost.crt;
ssl_certificate_key /etc/ssl/nginx/myhost.key;
# limit ciphersssl_ciphers HIGH:!ADH:!MD5;
ssl_protocols SSLv3 TLSv1;
ssl_prefer_server_ciphers on;
# increase proxy buffer to handle some OpenERP web requestsproxy_buffers 16 64k;
proxy_buffer_size 128k;
#general proxy settings# force timeouts if the backend diesproxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
# set headersproxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
# Let the OpenERP web service know that we ^ ^ re using HTTPS, otherwise# it will generate URL using http:// and not https://proxy_set_header X-Forwarded-Proto https;
# by default, do not forward anythingproxy_redirect off;
proxy_buffering off;
location / {proxy_pass http://odoo10;
location /longpolling {proxy_pass http://odoo10-im;
# cache some static data in memory for 60mins.
# under heavy load this should relieve stress on the OpenERP web interface a bit.
location /web/static/ {proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo10;

Any help is highly appreciated!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 11/16/16, 8:48 AM
Seen: 2341 times
Last updated: 12/19/16, 8:00 PM