Community mailing list archives

community@mail.odoo.com

Re: nginx proxy config

by
Csaba Tóth
- 05/10/2016 15:32:50

Hi!

Thanks for quick answer!
But i think i write ambiguously. I believe you wrote the solution for me when i see wrong ip address in the nginx logfiles.

But i see wrong IP address in the odoo server's log files, not in nginx logfiles.

BR,
Csaba



2016.05.10. 21:17 keltezéssel, Daniel Dico írta:

Hi Csaba,


Add the following lines to your nginx.conf in order to get the correct IP address:

set_real_ip_from  _proxy_ip_address_;
real_ip_header    X-Forwarded-For;
real_ip_recursive off;

You need to replace _proxy_ip_address_ with your IP address

Hope this helps


OERP Canada

Twitter LinkedIn

 

Daniel Dico
416.953.5939
dd@oerp.ca

OERP Canada
647.478.6811
3300 Bloor St. West, Unit 3140
Toronto,  ON  M8X 2X3
www.oerp.ca



IMPORTANT NOTICE: This email is intended only for the use of the Person(s) to whom it was addressed. It may contain information which is privileged & confidential. Any dissemination, distribution, copying, or other use of this message, or any of its contents or attachments by any person other than the intended recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are NOT the intended recipient please contact the sender and dispose of this email as soon as possible.






On May 10, 2016, at 3:08 PM, Csaba Tóth <csaba.toth@i3rendszerhaz.hu> wrote:

Hi!

How can i configure good the proxy setting with Odoo?

I use nginx as proxy frontend, but in the log files the client IP addess
is the proxy address not the client's. I use the --proxy-mode parameter.

Below is my relevant nginx config.

What am i missing?

Thanks for helping!
Csaba


charset utf-8;

client_max_body_size 100m;

# increase proxy buffer to handle some OpenERP web requests
proxy_buffering off;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
proxy_busy_buffers_size 128k;

proxy_intercept_errors on;
proxy_redirect off;

add_header X-Static no;

proxy_set_header         Host $http_host;
proxy_set_header         X-Real-IP $remote_addr;
proxy_set_header         X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header         X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header         X-Forwarded-Host $http_host;
proxy_set_header         X-Forwarded-Proto $scheme;

proxy_read_timeout          6h;
proxy_connect_timeout       5s;

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe