title: Reverse proxy to port 8069 on Engintron issues while it works on standard NGINX setup
body: <p>I have an Odoo app running on port 8069, and while this setup worked fine in my old server, my new server is using Engintron which seems to have a different method of working with vhosts. The standout issue is that under common_http.conf, this line becomes a duplicate of the vhost needed to run the app but is included in the automatically generated config that gets overridden whenever a new cpanel account is created, deleted, or when Engintron is updated. </p>
  
  <p>What would be the correct way of setting this up properly within Engintron?</p>
  
  <p>common_http.conf</p>
  
  <pre><code>location / {
      try_files $uri $uri/ @backend;
  }
  # This location / ends up getting included in the custom 
  # vhost which is needed for all of the sites except this Odoo app. 
  </code></pre>
  
  <p>custom_vhost.com.conf</p>
  
  <pre><code>upstream example{
   server 127.0.0.1:8069 weight=1 fail_timeout=0;
  }
  
  upstream example-chat {
   server 127.0.0.1:8072 weight=1 fail_timeout=0;
  }
  server {
      listen [::]:80;
      server_name delegates.example.com;
      return 301 https://delegates.example.com$request_uri;
  }
  server {
      listen [::]:80;
      server_name vendors.example.com;
      return 301 https://vendors.example.com$request_uri;
  }
  server {
      listen [::]:80;
      server_name example.com;
      return 301 https://example.com;
  }
  server {
      listen [::]:80;
      server_name *.example.com;
      return 301 https://example.com;
  }
  
  server {
      listen [::]:443 ssl;
      server_name pgadmin.example.com;
  
  # well-known_start
      location ^~ /.well-known {
          add_header Host-Header 192fc2e7e50945beb8231a492d6a8024;
          root /home/example/public_html;
      }
  # well-known_end
      ssl_certificate /var/cpanel/ssl/apache_tls/*.example.com/combined;
      ssl_certificate_key /var/cpanel/ssl/apache_tls/*.example.com/combined;
  
       add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
       add_header X-Content-Type-Options nosniff;
       add_header Cache-Control public;
  
      location / {
      deny all;
          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto https;
          proxy_pass http://127.0.0.1:5050;
      }
  }
  
  server {
          listen [::]:443 ssl;
          server_name example.com www.example.com;
          return 301 https://example.com;
  
  }
  server {
      listen [::]:443 ssl http2;
      server_name vendors.example.com delegates.example.com;
      client_max_body_size 200m;
      proxy_read_timeout 720s;
      proxy_connect_timeout 720s;
      proxy_send_timeout 720s;
      proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
  
      proxy_set_header Host $host;
      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_set_header X-NginX-Proxy true;
      #proxy_set_header X-Odoo-dbfilter ^%d\Z;
  
      proxy_redirect off;
      proxy_buffering off;
  
  # well-known_start
      location ^~ /.well-known {
          add_header Host-Header 192fc2e7e50945beb8231a492d6a8024;
          root /home/example/public_html;
      }
  # well-known_end
  
      ssl_certificate /var/cpanel/ssl/apache_tls/*.example.com/combined;
      ssl_certificate_key /var/cpanel/ssl/apache_tls/*.example.com/combined;
  
  
      access_log /var/log/nginx/odoo.access.log;
      error_log /var/log/nginx/odoo.error.log;
  
  # adds gzip options
      gzip on;
      gzip_types      text/css text/plain text/xml application/xml application/javascript application/x-javascript text/javascript application/json text/x-json;
      gzip_proxied    no-store no-cache private expired auth;
      #gzip_min_length 1000;
      gzip_disable     "MSIE [1-6]\.";
  
      location /longpolling {
       proxy_pass http://example-chat;
       }
  
  location ~* /web/static/ {
   gzip_static on;
   proxy_cache_valid 200 90m;
   proxy_buffering on;
   expires 864000;
   add_header Cache-Control public;
   proxy_pass http://example;
  }
  
  location / {
   error_page   403  =  https://example.com;
   proxy_pass http://example;
   proxy_redirect off;
   gzip_static on;
  }
  # The above location becomes a duplicate of the previous default location - which in turn fails the validity of the configuration.
  
  location ~* /web/content/ {
   gzip_static on;
   proxy_cache_valid 200 90m;
   proxy_buffering on;
   expires 864000;
   add_header Cache-Control public;
   proxy_pass http://example;
  }
  
  
  
  location /web/database/manager {
   deny all;
   error_page 403 https://example.com;
   proxy_pass      http://example;
  }
  }
  
  </code></pre>