İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Odoo 18 (from source) on Ubuntu running behind nginx - Odoo logs not showing real IP address

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
nginxNGINX
2 Cevaplar
4767 Görünümler
Avatar
M S

Hi,

I have Odoo 18 (using source) running behind Nginx successfully. For some reasons, the odoo logs do not show the real IP address for users. Nginx is configured to forward the IP (X-Forwarded-For) to backend and odoo config has proxy_mode set to true. I have done some searching on the Internet already and couldn't find anything in particular that may fix this issue.

Odoo log entry:

2025-05-01 03:39:19,437 4086 INFO odoo odoo.addons.base.models.res_users: Login failed for db:odoo login:oodf from 127.0.0.1

I am providing the nginx and odoo config files below as well below.

Nginx config

# Odoo servers
geo $limit {
  default 1;
  1.2.3.4/22 0;
  1.2.3.4/24 0;
  1.2.3.4/24 0;
  1.2.3.4/24 0;
  1.2.3.4/20 0;
}

map $limit $limit_key {
        0 "";
        1 $binary_remote_addr;
}

limit_req_zone $limit_key zone=general:10m rate=200r/m;

upstream odoo {
server 127.0.0.1:8069;
}

upstream odoochat {
server 127.0.0.1:8072;
}

map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}

# HTTP -> HTTPS
server {
  listen 80;
  server_name mywebsite.example.com;
  include snippets/letsencrypt.conf;
  return 301 https://mywebsite.example.com$request_uri;
}
# WWW -> NON WWW
server {
    listen 443 ssl http2;
    server_name www.mywebsite.example.com;
    ssl_certificate /etc/letsencrypt/live/mywebsite.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mywebsite.example.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/mywebsite.example.com/chain.pem;
    include snippets/ssl.conf;
    include snippets/letsencrypt.conf;

    return 301 https://mywebsite.example.com$request_uri;
}

server {
    listen 443 ssl http2;
    server_name mywebsite.example.com;
    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;

    # Proxy headers
    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;

    # SSL parameters
    ssl_certificate /etc/letsencrypt/live/mywebsite.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mywebsite.example.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/mywebsite.example.com/chain.pem;
    include snippets/ssl.conf;
    include snippets/letsencrypt.conf;


    # Increase client_max_body_size to your required ammount
    client_max_body_size 20M;

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

    # Redirect websocket requests to odoo gevent port
    location /websocket {
    proxy_pass http://odoochat;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_set_header X-Forwarded-Host $http_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 Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    proxy_cookie_flags session_id samesite=lax secure;
    proxy_redirect off;
  }

  # Handle longpoll requests
    location /longpolling {
        proxy_pass http://odoochat;
    }

    # Redirect requests to odoo backend server
    location / {
            # Add Headers for odoo proxy mode

            limit_req zone=general burst=50 nodelay;
            proxy_set_header X-Forwarded-Host $http_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_redirect off;
            proxy_pass http://odoo;

            # Enable HSTS
            add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
            # requires nginx 1.19.8
            proxy_cookie_flags session_id samesite=lax secure;
    }

    # Cache static files
    location ~*/web/static/ {
        limit_req zone=general;
        proxy_set_header X-Forwarded-Host $http_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_cache_valid 200 90m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://odoo;
        #add_header Content-Security-Policy $content_type_csp;
    }

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

Odoo Config file

[DEFAULT]
admin_passwd = abcdefghijklmn
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo/addons,/opt/odoo/odoo-custom-addons
proxy_mode = true
list_db = False ​ ​

Does anyone have any ideas as to what could the problem be?


Thanks,

Mohammad

0
Avatar
Vazgeç
Avatar
M S
Üretici En İyi Yanıt

Thanks for the suggestion. 

Unfortunately, changing "true" to "True" in the odoo config made no difference. Yes, I restarted the services as mentioned. Just  to be sure, I also rebooted the server after making the changes but odoo log is still showing 127.0.0.1

[DEFAULT]
admin_passwd = xxxxxxxxxxxx
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo/addons,/opt/odoo/odoo-custom-addons
proxy_mode = True
list_db = False

2025-05-03 10:13:23,229 1536 INFO odoo werkzeug: 127.0.0.1 - - [03/May/2025 10:13:23] "POST /web/login HTTP/1.0" 200 - 6 0.010 0.008
2025-05-03 10:13:23,369 1536 INFO odoo werkzeug: 127.0.0.1 - - [03/May/2025 10:13:23] "GET /web/binary/company_logo HTTP/1.0" 304 - 2 0.001 0.002
2025-05-03 10:13:23,728 1536 INFO odoo werkzeug: 127.0.0.1 - - [03/May/2025 10:13:23] "GET /web/webclient/translations/1746267203712 HTTP/1.0" 200 - 2 0.001 0.002
0
Avatar
Vazgeç
Avatar
Takahiro SUNAGA
En İyi Yanıt

Hi, 
Shouldn't "proxy_mode = true" instead of "proxy_mode = True"?
Try restarting the service after the fix.

Summary of Steps:

  1. Ensure proxy_mode = True is under the [options] section in odoo.conf.
  2. Restart the Odoo service (sudo systemctl restart odoo).
  3. Verify Nginx configuration (sudo nginx -t).
  4. Reload the Nginx service (sudo systemctl reload nginx).
  5. Check Nginx access logs to confirm it sees the real client IP.
  6. Try logging into Odoo again and check the Odoo logs.

0
Avatar
Vazgeç
Takahiro SUNAGA

Hi, How about using the `set_real_ip_from` directive to solve this?
Here's the documentation:
https://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from

Best regards,

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Nginx odoo 16 proxy and method not allowed 405
nginx
Avatar
Avatar
2
Eyl 24
3736
I'm trying to edit sites-available and sites-enabled - Configuration Builtin server Odoo 17
NGINX
Avatar
0
Tem 24
1613
How can I setup odoo on a path with nginx
nginx
Avatar
Avatar
1
May 24
4595
Nginx with Odoo configuration: host not found in upstream
nginx
Avatar
Avatar
Avatar
2
May 24
15956
Reverse Proxy Converts URL to Garbage Çözüldü
NGINX
Avatar
Avatar
1
Tem 23
5902
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now