Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
18363 มุมมอง

I deploy OpenERP behind nginx (1.7.4). My nginx configuration is simple near default, just proxying 80 to 8069. OpenERP is serving in port 8069. I set proxy_mode to True in openerp-server.conf. I also edit file wsgi_server.py in method application to allow HTTP_X_FORWARDED_FOR key in environ.

...

    if config['proxy_mode'] and ('HTTP_X_FORWARDED_HOST' in environ or 'HTTP_X_FORWARDED_FOR' in environ):
        environ['HTTP_X_FORWARDED_HOST'] = environ['HTTP_X_FORWARDED_FOR']
        return werkzeug.contrib.fixers.ProxyFix(application_unproxied)(environ, start_response)

...

I use werkzeug version 0.9.4.

The result is I still get local ip, 127.0.0.1, in the werkzeug info log, even though I access the server from another IP. Howto show real client IP in werkzeug log if OpenERP serve behind reverse-proxy?

[1] https://www.odoo.com/forum/help-1/question/nginx-reverse-proxy-on-80-443-32052, my nginx configuration is similar to this

[2] https://www.odoo.com/forum/help-1/question/preserving-clients-remote-adress-when-running-odoo-behind-apache-ssl-proxy-60967, another related question

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Not sure if it can be considered thread necromancy, but have a look a this for a v8/9 solution:

https://blog.hartwork.org/?p=2655 

It worked for me.

อวตาร
ละทิ้ง

How do you apply this solution?

คำตอบที่ดีที่สุด

Check this out:

Wrong IP-address in werkzeug's log messages when in proxy mode 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มี.ค. 15
7319
1
เม.ย. 23
58021
How to run tests แก้ไขแล้ว
4
เม.ย. 23
45734
Odoo performance issue แก้ไขแล้ว
1
ม.ค. 24
15657
1
มี.ค. 15
4449