Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Configure Odoo 8 to generate correct URLs when behind reverse proxy?

By
Boyan
on 3/19/15, 8:29 AM 3,131 views

I’m trying to set up Odoo 8 behind Nginx reverse proxy, where SSL termination is done on Nginx. The problem is that Odoo keeps setting the wrong protocol (http) when generating the URL for redirect_uri parameter for OAuth2 Google authentication.

I have the following HTTP headers set for proxy_pass:

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-Host $http_host;

proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto https;

proxy_set_header Front-End-Https On;

It seems Odoo doesn't care about these headers except for Host. Is there some other header I should set?

I also tried setting Odoo system parameters: web.base.url, but that has no effect either.

How can I force Odoo to use https when assembling URLs? Please help!

Thank you so much for mention "proxy_set_header X-Forwarded-Host $http_host;". I missed this in my configuration. But now it works too. Thank you very much. Was trying to find the error since 2 days...

Stefan Reisich
on 6/26/15, 6:14 AM
3
Boyan
On 3/23/15, 6:24 PM

Problem solved. I was missing --proxy-mode option, or alternatively proxy_mode = True in openerp-server.conf. Without this option Odoo ignores X-Forwarded-... headers. 

-1

Ermin Trevisan

--Ermin Trevisan--
3548
| 6 3 7
Walchwil, Switzerland
--Ermin Trevisan--


Ermin Trevisan
On 6/26/15, 10:39 AM

Can anybody show the same for Apache?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

4 follower(s)

Stats

Asked: 3/19/15, 8:29 AM
Seen: 3131 times
Last updated: 3/2/16, 5:48 PM