I'm running Odoo 18.0-20241108 (Community Edition) on Ubuntu 22.04, which I deployed through the Linode Marketplace.
I have a contact page on the website that fails to submit after clicking the "submit" button. The error that's returned on the page is:
"An error has occured, the form has not been sent."
The error that's returned in the developer console of the browser is:
"500 Internal server error"
After a lot of digging, I've determined that the issue is a websocket error. And I suspect (maybe incorrectly) that NGINX isn't reading my custom config file.
Here's the contents of the file:
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
server {
listen 80;
server_name mydomain.co.uk www.mydomain.co.uk;
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;
# log
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
location /longpolling {
proxy_pass http://odoochat;
}
# 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;
}
I've also checked the error log file and the error that's being returned is as follows:
2024/11/18 09:25:39 [error] 37945#37945: *5812 connect() failed (111: Unknown error) while connecting to upstream, client: my-ip, server: my-ip.linodeusercontent, request: "GET /websocket?version=18.0-2 HTTP/1.1", upstream: "http://[::1]:8069/websocket?version=18.0-2", host: "my-ip.linodeusercontent"
Please note that in the code above, I've substituted "my-ip" and "my-domain" for their correct values.
There are a couple of things that stand out to me as odd:
- The line from the error log references the default domain name for the server as opposed to my actual domain name, but I'm not sure if this is significant.
- The value for the upstream server seems to be empty but I'm not sure why or how to fix it.
I've spent hours googling this issue but I'm not getting anywhere. Also, I've found several forums that reference a file called odoo-server.conf but this file is nowhere to be found on my server. I don't even have an Odoo directory anywhere!
Besides this issue, the website is working perfectly.
Thanks in advance for your help.