0

I have been running in some problems. I have scanned serverfault and google, but i can't get it to work as it should. I am at a loss.

I have odoo 14 running on Debian listening on port 8069. Odoo works just fine. I have Nextcloud running on ports 80, 443 and 4443 on apache2 server. Works just fine.

I want to set up nginx with reverse proxy to use SSL connection to the odoo-server on port 8069.

my setup: /etc/nginx/sites-enabled/odoo.bruges

upstream odoo.bruges {
 server 127.0.0.2:8069;
}

#upstream odoo-chat {
# server 192.168.0.95:8072;
#}

server {
    listen 8080;
    server_name odoo.bruges;
    return 301 https://$server_name$request_uri;
}

server {
   listen 8443 ssl http2;
   server_name odoo.bruges;

   ssl_certificate /etc/ssl/mycerts/nginx.pem;
   ssl_certificate_key /etc/ssl/mycerts/nginx.key;
   ssl_session_timeout 1d;
   ssl_session_cache shared:SSL:50m;
   ssl_session_tickets off;

   ssl_dhparam /etc/nginx/dhparam2048.pem;

   ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
   ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-$
   ssl_prefer_server_ciphers on;

   add_header Strict-Transport-Security max-age=15768000;

   #ssl_stapling on;
   #ssl_stapling_verify on;
   #ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;
   #resolver 8.8.8.8 8.8.4.4;

   access_log /var/log/nginx/odoo.access.log;
   error_log /var/log/nginx/odoo.error.log;

   proxy_read_timeout 720s;
   proxy_connect_timeout 720s;
   proxy_send_timeout 720s;
   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;

   location / {
     proxy_redirect off;
     proxy_pass http://127.0.0.2:8069;
   }

  # location /longpolling {
  #     proxy_pass http://192.168.0.95:8072;
  # }

   location ~* /web/static/ {
       proxy_cache_valid 200 90m;
       proxy_buffering    on;
       expires 864000;
       proxy_pass http://127.0.0.2:8069;
  }

  # gzip
  gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
  gzip on;
}

my setup of hosts /etc/hosts

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1 nextcloudpi
#192.168.0.95 Bruges
127.0.0.2 odoo.bruges

my hostname file: /etc/hostname

nextcloudpi
odoo.bruges

netstat outputs:

pi@nextcloudpi:/etc/nginx/sites-enabled $ netstat -tnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8069            0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 ::1:5432                :::*                    LISTEN
tcp6       0      0 :::25                   :::*                    LISTEN
tcp6       0      0 :::4443                 :::*                    LISTEN
tcp6       0      0 :::443                  :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN

pi@nextcloudpi:/etc/nginx/sites-enabled $ netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8069            0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
tcp        0    256 192.168.0.95:22         192.168.0.98:50825      ESTABLISHED
tcp        0      0 192.168.0.95:8443       192.168.0.98:61929      TIME_WAIT
tcp        0      0 192.168.0.95:8069       192.168.0.98:61932      TIME_WAIT
tcp        0      0 127.0.0.1:47648         127.0.0.1:8069          TIME_WAIT
tcp        0      0 192.168.0.95:56110      64.233.165.26:25        ESTABLISHED
tcp        0      0 192.168.0.95:8069       192.168.0.98:61919      TIME_WAIT
tcp        0      0 192.168.0.95:8069       192.168.0.98:61936      ESTABLISHED
tcp        0      0 192.168.0.95:8443       192.168.0.98:61928      ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 ::1:5432                :::*                    LISTEN
tcp6       0      0 :::25                   :::*                    LISTEN
tcp6       0      0 :::4443                 :::*                    LISTEN
tcp6       0      0 :::443                  :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN

pi@nextcloudpi:/etc/nginx/sites-enabled $ netstat -at
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp        0      0 localhost:postgresql    0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:smtp            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8443            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8069            0.0.0.0:*               LISTEN
tcp        0      0 localhost:mysql         0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:http-alt        0.0.0.0:*               LISTEN
tcp        0      0 nextcloudpi.Dlink:8069  DESKTOP-Office.Dl:61954 ESTABLISHED
tcp        0      0 nextcloudpi.Dlink:8069  DESKTOP-Office.Dl:61953 TIME_WAIT
tcp        0    256 nextcloudpi.Dlink:ssh   DESKTOP-Office.Dl:50825 ESTABLISHED
tcp        0      0 nextcloudpi.Dlink:8069  DESKTOP-Office.Dl:61968 TIME_WAIT
tcp        0      0 nextcloudpi.Dlink:56110 lg-in-f26.1e100.ne:smtp ESTABLISHED
tcp        0      0 nextcloudpi.Dlink:8069  DESKTOP-Office.Dl:61936 TIME_WAIT
tcp        0      0 nextcloudpi.Dlink:8443  DESKTOP-Office.Dl:61928 ESTABLISHED
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN
tcp6       0      0 localhost:postgresql    [::]:*                  LISTEN
tcp6       0      0 [::]:smtp               [::]:*                  LISTEN
tcp6       0      0 [::]:4443               [::]:*                  LISTEN
tcp6       0      0 [::]:https              [::]:*                  LISTEN
tcp6       0      0 [::]:http               [::]:*                  LISTEN

Any help would be greatly appreciated. I have been trying for over 12 hours before posting this request.

nginx never points to the internal port of 8069 where the odoo-server is running. If it points anywhere in all my attempts it is too outside addresses or something like 127.0.0.2:8069/web.

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.