2 答案
Hi,
Please check the nginx log for more details about the same.
Odoo Nginx: Configure Odoo With Nginx As a Reverse Proxy
Thanks
Thanks your reply.
actually when installed nginx with Odoo 15, the nginx test was also successful. (sudo nginx -t)
I followed the steps of same video that you shared and created new odoo15.conf in etc/nginx/sites-available. After creating this new file it started giving error and sudo nginx -t was also unsuccessful.
Following are the parameters of file which I created:
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
server {
listen 80;
server 159.xxx.xx.xxx;
proxy_readx_timeout 300;
proxy_connect_timeout 300;
proxy_send_timeout 300;
# 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;
}
Following is the error of sudo nginx -t:
nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/odoo15.conf:12
nginx: configuration file /etc/nginx/nginx.conf test failed