Giter Site home page Giter Site logo

Comments (6)

minhng92 avatar minhng92 commented on August 25, 2024 2

Hi @killmasta93 ,

I usually set these couple parameters, base url and freeze. If you don't set web.base.url.freeze to True, the web.base.url will be changed every login. Please skip it if you already did.

image

When we deploy Odoo with a proxy (nginx, traefik, caddy, ...), we should configure proxy_mode = True in odoo.conf.

https://github.com/minhng92/odoo-16-docker-compose/blob/master/etc/odoo.conf#L88

from odoo-16-docker-compose.

minhng92 avatar minhng92 commented on August 25, 2024 1

Hi @killmasta93 , your configuration looks fine. I've never met this issue, but I guess this weird come from the proxy. Try again with one these samples:

  1. Sample from official Odoo documentation: https://www.odoo.com/documentation/16.0/administration/install/deploy.html#id7
  2. My production config
server {
    listen 443 ssl;
    server_name odoo.**********************************************;

    ssl_certificate **********************************************;
    ssl_certificate_key ******************************************;
    ssl_prefer_server_ciphers on;

    sendfile on;

    charset utf-8;
    # max upload size
    client_max_body_size 50G; # adjust to taste

    proxy_read_timeout 600000;
    proxy_connect_timeout 600000;
    proxy_send_timeout 600000;

    proxy_set_header Connection keep-alive;

    location / {
        proxy_pass http://**.***.***.**:10016/;        
    }
    location /longpolling/ {
        proxy_pass http://**.***.***.**:20016/longpolling/;
    }
}

from odoo-16-docker-compose.

killmasta93 avatar killmasta93 commented on August 25, 2024

thank you so much

from odoo-16-docker-compose.

killmasta93 avatar killmasta93 commented on August 25, 2024

Hi again, wanted to reopen the bug, as whats odd is that on the login screen when i login it changes back to the internal IP
already have the web freeze
this only happens in the login screen

the rest is working fine
it seems when i try to login in the Request URL

Request URL: https://odoo.domain.com/web/login


Request URL: https://odoo.domain.com/web/login
Request Method: POST
Status Code: 303 
Remote Address: xxxxxx:443
Referrer Policy: strict-origin-when-cross-origin

which it loops back to the internal IP
not sure if its a nginx issue or ODOO

image

image

NGINX Proxy using SWAG

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name odoo.*;
    include /config/nginx/ssl.conf;

  # Add Headers for odoo proxy mode
  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;
  add_header X-Frame-Options "SAMEORIGIN";
  add_header X-XSS-Protection "1; mode=block";
  proxy_set_header X-Client-IP $remote_addr;
  proxy_set_header HTTP_X_FORWARDED_HOST $remote_addr;

    client_max_body_size 0;
 if ($lan-ip = yes) { set $geo-whitelist yes; }
     if ($geo-whitelist = no) { return 404; }

#   increase    proxy   buffer  size
  proxy_buffers   16  64k;
  proxy_buffer_size   128k;

  proxy_read_timeout 900s;
  proxy_connect_timeout 900s;
  proxy_send_timeout 900s;

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

  types {
  text/less less;
  text/scss scss;
  }

  #   enable  data    compression
  gzip    on;
  gzip_min_length 1100;
  gzip_buffers    4   32k;
  gzip_types  text/css text/less text/plain text/xml application/xml application/json application/javascript application/pdf image/jpeg image/png;
  gzip_vary   on;
  client_header_buffer_size 4k;
  large_client_header_buffers 4 64k;

  location / {
  proxy_pass    http://192.168.6.20:10016;
  # by default, do not forward anything
  proxy_redirect off;
  }

  location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {
  expires 2d;
  proxy_pass http://192.168.6.20:10016;
  add_header Cache-Control "public, no-transform";
  }
  # cache some static data in memory for 60mins.
  location ~ /[a-zA-Z0-9_-]*/static/ {
  proxy_cache_valid 200 302 60m;
  proxy_cache_valid 404      1m;
  proxy_buffering    on;
  expires 864000;
  proxy_pass    http://192.168.6.20:10016;
  }
}

Thank you

from odoo-16-docker-compose.

killmasta93 avatar killmasta93 commented on August 25, 2024

hi @minhng92 i was wondering if you got a chance to look at the error?
Thank you

from odoo-16-docker-compose.

killmasta93 avatar killmasta93 commented on August 25, 2024

yeah that worked perfectly

from odoo-16-docker-compose.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.