Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Too Many Redirects Error When Attempting to Run Odoo via NGiNX Reverse Proxy

Subscribe

Get notified when there's activity on this post

This question has been flagged
installationNGINX
3 Replies
8647 Views
Avatar
coffeedrunk

I have tried a few different attempts and I keep getting the same issue with too many redirects.

I am still to go through the Odoo installation process, I wanted to install it through the domain and in order to set that up I need to get this reverse proxy working.

I am also using Cloudflare origin server certificates for this. This is the latest NGiNX configuration I have done:

#odoo server
upstream odoo {
server 192.168.4.100:8069;
}
upstream odoochat {
server 192.168.4.100:8072;
}

# http -> https
server {
listen 80;
server_name odoo.mydomain.com;
rewrite ^(.*) https://$host$1 permanent;
}

server {
listen 443 ssl http2;
server_name erp.mydomain.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;

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

# SSL parameters
ssl_certificate /etc/cloudflare/mydomain/odoo/cert.pem;
ssl_certificate_key /etc/cloudflare/mydomain/odoo/key.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;

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

# Redirect longpoll requests to odoo longpolling port
location /longpolling {
proxy_pass http://odoochat;
}

# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}

# common gzip
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
0
Avatar
Discard
Avatar
Jort de Vreeze
Best Answer

The issue of "too many redirects" often happens when there is a loop condition in your configuration. In this case, the issue might be because of the server_name directive in your configurations.

You have a server block listening on port 80, which is redirecting all traffic to the https version of the same domain:

server {
listen 80;
server_name odoo.mydomain.com;
rewrite ^(.*) https://$host$1 permanent;
}

However, the server block listening on port 443 is expecting a different domain:

server {
listen 443 ssl http2;
server_name erp.mydomain.com;
...
}

You should modify your configuration to use the same server_name for both the 80 and 443 server bocks. It should look something like this:

# http -> https
server {
listen 80;
server_name odoo.mydomain.com;
rewrite ^(.*) https://$host$1 permanent;
}

server {
listen 443 ssl http2;
server_name odoo.mydomain.com;
...
}

I hope this helps!

0
Avatar
Discard
Avatar
coffeedrunk
Author Best Answer

That nginx config is problematic, it errors out at the domain directive so it seems like it is a dated copy that doesn't work.

nginx: [emerg] unknown directive "odoomates.tech"

line 12


0
Avatar
Discard
Niyas Raphy (Walnut Software Solutions)

you have replace the above with your domain name in conf file

Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

Can you copy this nginx configuration sample and try with this:  https://github.com/odoomates/odoosamples/blob/main/odoo_nginx_conf

video: https://www.youtube.com/watch?v=-hVYQd7A7PQ

configuring domain name in odoo:  https://www.youtube.com/watch?v=BMCOzrAur1A

Thanks

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

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

Sign up
Related Posts Replies Views Activity
Install Odoo Comunity 18 without 15 days free trial version Solved
installation
Avatar
Avatar
3
Jul 25
4526
Setting up a new odoo 18 server and am unable to install gevent==21.8.0
installation
Avatar
Avatar
Avatar
Avatar
3
Jun 25
7085
How to install Odoo 18 from Tar Source
installation
Avatar
Avatar
Avatar
Avatar
Avatar
5
May 25
7689
Installation tutorial for Odoo 17
installation
Avatar
Avatar
Avatar
2
May 25
3580
Which configuration is used
installation
Avatar
Avatar
1
Aug 24
3369
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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