Skip to Content
Menu
This question has been flagged
9 Replies
9140 Views

Hi there,


I am setting up an odoo server in a docker environment where nginx proxy manager is installed. I was able to configure the host and add SSL encryption. The reverse proxy works fin and I reach odoo via subdomain easily.


But:

There are two issues which I think are maybe related and I hope to get an idea what is missing in the nginx proxy manager config:


In the odoo logs I see constantly the error 400 bad request, whil using the odoo application as usual. and second issue is that I try to use an api module which connects to a woocommerce webshop to sync data. I can't manage to get a connection to or from the webshop.

Is there anything else I need to set up for API connections and make them work?

thanks in advance!

Avatar
Discard
Author

Hi Hiyas,
like I already told the guys from Cybrosys, the question is more about how to configure it in combination with nginx PROXY MANAGER! This makes a lot of things easier (f.e.x you don't need to care about SSL certificates, it is just done fully automated within 2 mouseclicks).
My question here was more about how to configure a configuration which reflects the well-knows settings in the manually written config files of nginx.

If you manage a docker system with multiple applications, nginx PROXY MANAGER ist musch easier to handle instead of writing a lot of config files.

So has anyone tried to set up odoo in combination with nginx PROXY MANAGER?

My posted setup here seems to work fine after I added some snipplets manually in the advanced tab. But I fear I have some unnecessary options in there. However, for now it works. I was just wondering, if any other guy here implemented odoo in combination with the nice and easy to use nginx PROXY MANAGER

Thank you very much FL1 s.r.o for your solution.
It helped me to solve some problems with the web page.
Next ponit to solve is that internal chat is not working, you have to refres the page to see the answers. It means that websocket/longpolling(deprecated) is not working.

¿Anyone with same problem?

Best Answer

hi,

i created a conf for nginx proxy manager for odoo 15.0 and 16.0

the conf file and the working configuration )ready for production is here:

Custom locations: "/" setup:

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;
proxy_redirect off;

Custom locations: "/websocket"

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;

Advanced: "Custom nginx configuration"

# common gzip
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 500M;
sendfile on;
send_timeout 600s;
keepalive_timeout 300;


inside the odoo-server.conf change setup xml interface, and proxy mode:

; This is the password that allows database operations:
admin_passwd = dddfdfdfsfger
http_port = 8069
longpolling_port = False
gevent_port = 8072
xmlrpcs_interfaces = 0.0.0.0
workers = 2
max_cron_threads = 1
proxy_mode = True
logfile = /var/log/odoo/odoo-server.log
addons_path=/odoo/odoo-server/addons,
        /odoo/custom/addons,

the full guide is here:

https://github.com/crottolo/odoo_auto_install/tree/main

https://fl1.cz/install-odoo-nginx-proxy-manager




Avatar
Discard
Author

Hi Fl1,
I guess that was the answer that I was looking for. I will test it these days and mark your answer as solced in case it works fine. Thanks for sharing!

:-)

Best Answer

Odoo is running fine on my system, and I have also applied the above configuration in Nginx. However, I am still facing issues when trying to access Odoo via Nginx from the outside, or when trying to access the web editor within Odoo. I am getting the following error:


UncaughtPromiseError > OwlError

Uncaught Promise > An error occured in the owl lifecycle (see this Error's "cause" property)

Occured on on 2024-12-04 20:16:52 GMT


OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)


    Error: An error occured in the owl lifecycle (see this Error's "cause" property)


        at handleError (...web.assets_web.min.js:952:101)


        at App.handleError (...web.assets_web.min.js:1594:29)


        at RootFiber.complete (...web.assets_web.min.js:983:37)


        at Scheduler.processFiber (...web.assets_web.min.js:1561:43)


        at Scheduler.processTasks (...web.assets_web.min.js:1555:62)


        at ...web.assets_web.min.js:1552:67




Caused by: TypeError: Cannot read properties of null (reading 'body')


    at ...web.assets_web.min.js:18686:47


    at MenuDialog.<anonymous> (...web.assets_web.min.js:1609:145)


    at RootFiber.complete (...web.assets_web.min.js:981:196)


    at Scheduler.processFiber (...web.assets_web.min.js:1561:43)


    at Scheduler.processTasks (...web.assets_web.min.js:1555:62)


    at ...web.assets_web.min.js:1552:67

Avatar
Discard
Author

Hi Falco,
I'm not sure, but I don't think this is an issue of nginx config. Looks more like a browser cache issue. Did you tried to empty your browser cache?
BTW, which odoo version are you using?

Best regards,
Riccardo

Best Answer

In my experience, in addition to implementing the recommendations of FL1 s.r.o., I have activated the proxy mode and it has worked correctly through the Nginx Proxy Manager - Odoo17 CE.

Avatar
Discard
Best Answer

Hi, Fl1
I have already follow the setup above, but still get error on accessing web editor with the error details below:

"Mixed Content: The page at 'http://mydomain.com/'. This request has been blocked; the content must be served over HTTPS."

I thought it was because I'm using migrated database from odoo15 to odoo16, however when i create new database the error is still the same and i can't access web editor. Any idea how to solve that?

Avatar
Discard

Check in technical function -> system parameter -> web.base.url with {{your_domain.com}}.
example https://fl1.cz

after restart odoo and check the issue

I have have the same error, Mixed Content, the web.base.url is setup as "https://"
Did you resolve it ?

Best Answer

Hi, you can follow this: https://youtu.be/-3wV7A_4s-w

Hope it helps

Avatar
Discard
Best Answer

Hi,

To configure Nginx with Odoo:  Configure Odoo With Nginx As a Reverse Proxy
Thanks

Avatar
Discard
Author Best Answer

Hi guys from Cybrosys,
I already know your great article. It is fine if you deply a standalone nginx webserver and do the configuration there. But in my case I am running some other services in docker as well, so I like to manage all this via nginx proxy manager UI. And here it is a little bit tricky to set it up correctly.

But finally I think my issue is maybe solved. I added some strings in advanced section of the host settings:

But maybe I have some dublettes here?

location /websocket {

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "Upgrade";

proxy_pass http://odoo16-live:8072;

proxy_redirect off;

}


gzip_types text/css text/less text/plain text/xml application/xml application/json application/ja$

gzip on;


client_body_in_file_only clean;

client_body_buffer_size 32k;

client_max_body_size 500M;

sendfile on;

send_timeout 600s;

keepalive_timeout 300;


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;

And btw, I have enabled all 3 options in general tab (incl websocket und block common exploits). The 400 bad request issue is gone and odoo reports to work fine on port 8069 and 8072.

Additionally I have enabled proxy_mode = true in odoo.conf.


Hope that helps

Avatar
Discard
Best Answer

i have same issue 

when i open pos from mobile 


Avatar
Discard
Related Posts Replies Views Activity
0
Feb 20
3295
3
May 24
22083
0
Oct 22
3464
1
Dec 20
8058
1
Jan 20
4125