docker icon indicating copy to clipboard operation
docker copied to clipboard

default setup with nginx reverse proxy giving bad requests

Open schealex opened this issue 4 years ago • 3 comments

Hello,

i'm using this compose file:

version: '2'
services:
  web:
    image: odoo:12.0
    depends_on:
      - db
    ports:
      - "8069:8069"
    volumes:
      - /data/odoo/odoo-web-data:/var/lib/odoo
      - /data/odoo/config:/etc/odoo
      - /data/odoo/addons:/mnt/extra-addons
    environment:
      VIRTUAL_HOST: odoo.mydomain.de 
      VIRTUAL_PORT: 8069
      LETSENCRYPT_HOST: odoo.mydomain.de
      LETSENCRYPT_EMAIL: [email protected]
  db:
    image: postgres:10
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - /data/odoo/odoo-db-data:/var/lib/postgresql/data/pgdata

but when accessing the odoo.mydomain.de:8069 i get bad request messages in docker console. Without port i get a bad gateway 502.

db_1   |
db_1   | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1   |
db_1   | 2021-02-15 18:58:11.524 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2021-02-15 18:58:11.524 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2021-02-15 18:58:11.526 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2021-02-15 18:58:11.546 UTC [27] LOG:  database system was shut down at 2021-02-15 18:58:08 UTC
db_1   | 2021-02-15 18:58:11.553 UTC [1] LOG:  database system is ready to accept connections
web_1  | 2021-02-15 18:58:13,441 1 INFO ? odoo: Odoo version 12.0-20210210
web_1  | 2021-02-15 18:58:13,442 1 INFO ? odoo: Using configuration file at /etc/odoo/odoo.conf
web_1  | 2021-02-15 18:58:13,442 1 INFO ? odoo: addons paths: ['/mnt/extra-addons', '/usr/lib/python3/dist-packages/odoo/addons']
web_1  | 2021-02-15 18:58:13,442 1 INFO ? odoo: database: odoo@db:5432
web_1  | 2021-02-15 18:58:13,615 1 INFO ? odoo.addons.base.models.ir_actions_report: Will use the Wkhtmltopdf binary at /usr/local/bin/wkhtmltopdf
web_1  | 2021-02-15 18:58:13,862 1 INFO ? odoo.service.server: HTTP service (werkzeug) running on a1dc52e2752a:8069
web_1  | 2021-02-15 18:58:25,237 1 ERROR ? werkzeug: 84.119.200.4 - - [15/Feb/2021 18:58:25] code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03à\x04\x93{Z©V¯ÄêÜ\x97\x94ÌïÅÒBN\x07') - - -
web_1  | 2021-02-15 18:58:25,237 1 INFO ? werkzeug: 84.119.200.4 - - [15/Feb/2021 18:58:25] "üà�{Z©V¯ÄêÜ��ÌïÅÒBN" HTTPStatus.BAD_REQUEST - - - -
web_1  | 2021-02-15 18:58:28,776 1 ERROR ? werkzeug: 84.119.200.4 - - [15/Feb/2021 18:58:28] code 400, message Bad request syntax ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03kùüǦ2S\x06!\x93è«ÀC\x9dD[\x9eB÷R?õÛIs\x03!`\x1cO$ "\x1999Èu°\x06¤Qt\x9d7\x7f\x11m\x8e¥L\x9b\x1b\x95!1\x08\x93ÙÀh\x11\x1eÀ\x00"JJ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') - - -
web_1  | 2021-02-15 18:58:28,776 1 INFO ? werkzeug: 84.119.200.4 - - [15/Feb/2021 18:58:28] "ükùüǦ2S!�è«ÀC�D[�B÷R?õÛIs!`O$ "99Èu°¤Qt�m�¥L�▒!�ÙÀhÀ"JJÀ+À/À,À0̨̩ÀÀ��/5" HTTPStatus.BAD_REQUEST - - - -

schealex avatar Feb 15 '21 18:02 schealex

I am having the same issue. Trying to make odoo run behind a reverse proxy. I get the same bad request error. Did you find a solution?

FudiHub avatar Jul 10 '21 16:07 FudiHub

Sadly no. And it doesn't seem like there is someone that i actively supporting this.

schealex avatar Jul 16 '21 11:07 schealex

I solved the problem for me yesterday. Check the proxy conf and make sure proxy_pass uses http instead of https! Configure a rewrite to https in the server section for port 80.

FudiHub avatar Jul 17 '21 19:07 FudiHub