• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Odoo Plesk Reverse Proxy

I am trying to create a reverse proxy for nginx, however I can not get it to work. Here is my config that works on ubuntu 16.04 with NGINX only


upstream odooweb {

server 0.0.0.0:8069 weight=1 fail_timeout=300s;

}

upstream odooweb-im {

server 0.0.0.0:8072 weight=1 fail_timeout=300s;

}

server {

# server port and name

listen 80;

server_name *** servers ip address ***;

# Specifies the maximum accepted body size of a client request,

# as indicated by the request header Content-Length.

client_max_body_size 200m;

#log files

access_log /var/log/nginx/odoo-access.log;

error_log /var/log/nginx/odoo-error.log;

proxy_connect_timeout 600;

proxy_send_timeout 600;

proxy_read_timeout 600;

send_timeout 600;

keepalive_timeout 600;

gzip on;

gzip_disable "msie6";

gzip_vary on;

gzip_proxied any;

gzip_comp_level 6;

gzip_buffers 16 8k;

gzip_http_version 1.1;

gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss application/rss+xml text/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype image/bmp image/png image/gif image/jpeg image/jpg;

# increase proxy buffer to handle some odoo web requests

proxy_buffers 16 64k;

proxy_buffer_size 128k;

location / {

proxy_pass http://odooweb;

# force timeouts if the backend dies proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

# set headers

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto http;

# by default, do not forward anything

proxy_redirect off; }

location /longpolling {

proxy_pass http://odooweb-im; }

# cache some static data in memory for 60mins.

# under heavy load this should relieve stress on the odoo web interface a bit.

location ~* /web/static/ {

proxy_cache_valid 200 60m;

proxy_buffering on;

expires 864000;

proxy_pass http://odooweb;

}

}
 
I am trying to set up the reverse proxy config for an erp software called Odoo. Since I am using Plesk I can not configure the proxy in the normal way of Ubuntu /ect/nginx/sites_enabled/...etc

seems like the configuration needs to be put directly in the plesk.
 
From what I understand, odoo brings its own web server, and you want to run it as the backend while Nginx remains the frontend and serves your odoo installation plus continues to serve Plesk virtual hosts? So you will end up with two backends, one for port 8069 (odoo) and one for 7080 and 7081 (Apache). How do you want to create the difference criteria between them? By a subdomain? Subdirectory? You need some criteria first by that Nginx can tell whether to forward the request to 8069 or to 7080.

I'd first look at this file: /etc/nginx/plesk.conf.d/server.conf . It contains the basic logic for what you want to achieve. You need to expand this with location sections that work as traffic selectors to forward odoo traffic to the odoo backend and other traffic to Apache. From there it is more or less a copy and paste operation to add another location block in the server blocks - however, this file will be overwritten by Plesk webserver reconfigurations. To prevent this, you need to either edit /usr/local/psa/admin/conf/templates/default/nginx.php or create a custom configuration file (for details see description here: [HOWTO] How to correctly modify virtual host settings ).

To be frankly honest: I'd never ever construct this mixture of Plesk and an additional web server. Looking at the number of internal tickets in our company that we have with simple default Plesk installations I don't think such modifications will promise a long living solution. It is simply too complicated and too vulnerable to failures by future updates or changes to configuration files, locations or new directives that updates might bring in.

If you absolutely want to do this, maybe you should consider running odoo in a Docker container. odoo provides a Docker image and Plesk Onyx supports Docker. This will probably be the much better approach, because it won't interfere with existing Plesk configuration files and templates.
 
From what I understand, odoo brings its own web server, and you want to run it as the backend while Nginx remains the frontend and serves your odoo installation plus continues to serve Plesk virtual hosts? So you will end up with two backends, one for port 8069 (odoo) and one for 7080 and 7081 (Apache). How do you want to create the difference criteria between them? By a subdomain? Subdirectory? You need some criteria first by that Nginx can tell whether to forward the request to 8069 or to 7080.

I'd first look at this file: /etc/nginx/plesk.conf.d/server.conf . It contains the basic logic for what you want to achieve. You need to expand this with location sections that work as traffic selectors to forward odoo traffic to the odoo backend and other traffic to Apache. From there it is more or less a copy and paste operation to add another location block in the server blocks - however, this file will be overwritten by Plesk webserver reconfigurations. To prevent this, you need to either edit /usr/local/psa/admin/conf/templates/default/nginx.php or create a custom configuration file (for details see description here: [HOWTO] How to correctly modify virtual host settings ).

To be frankly honest: I'd never ever construct this mixture of Plesk and an additional web server. Looking at the number of internal tickets in our company that we have with simple default Plesk installations I don't think such modifications will promise a long living solution. It is simply too complicated and too vulnerable to failures by future updates or changes to configuration files, locations or new directives that updates might bring in.

If you absolutely want to do this, maybe you should consider running odoo in a Docker container. odoo provides a Docker image and Plesk Onyx supports Docker. This will probably be the much better approach, because it won't interfere with existing Plesk configuration files and templates.

Hola, estoy tratando de instalar Odoo15 en un docker y no consigo realizarlo, podría indicarme los pasos a seguir?
 
Back
Top