Skip to Content
Menu
This question has been flagged
1 Reply
10819 Views

Hi!

I try to run a Odoo Docker container behind a NGINX reverse proxy. My problem is that the container is not answering on the specified port over HTTP and therefore the NGINX proxy_pass ends in a 502.


My docker-compose.yml:

version: '2'
services:
  db:
    image: 'postgres:9.4'
    restart: always
    environment:
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - '/srv/odoo/postgres/data:/var/lib/postgresql/data/pgdata'
  web:
    image: 'odoo:10.0'
    restart: always
    environment:
      - HOST=db
      - USER=odoo
      - PASSWORD=odoo
      - VIRTUAL_HOST=odoo.mycompany.io
      - VIRTUAL_PORT=8181
    depends_on:
      - db
    ports:
      - '8181:8096'
    volumes:
      - '/srv/odoo/data:/var/lib/odoo'
      - '/srv/odoo/extra-addons:/mtn/extra-addons'
      - '/srv/odoo/config:/etc/odoo'


And my nginx.conf:

server {

           listen 80;
           server_name odoo.mycompany.io;

           location / {
                proxy_pass http://localhost:8181;
                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 http;
           }

            access_log /var/log/nginx/odoo-ssl-access.log;
            error_log /var/log/nginx/odoo-ssl-error.log;
        }


The error-log shows:

2017/06/09 14:45:41 [error] 9042#9042: *102 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xx.xx.xx.xx, server: odoo.mycompany.io, request: "GET / HTTP/1.1", upstream: "http://[::1]:8181/", host: "odoo.mycompany.io"


 Can anyone please help me?


Thanks,

Thomas







Avatar
Discard
Best Answer
 ports:      - '8181:8096'


I think odoo port should be 8069, not 8096

Avatar
Discard
Related Posts Replies Views Activity
0
Feb 20
2836
1
Oct 19
3932
2
Jan 19
8210
1
Nov 17
8508
6
Dec 23
18632