magnum does not client ip when behind haproxy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Magnum |
In Progress
|
Undecided
|
Ricardo Rocha |
Bug Description
When running behind a reverse proxy, Magnum logs the proxy IP only.
In our setup we have 3 magnum frontend nodes behind HAProxy. HAProxy is publishing the X-Forwarded-For header which we also use for other OpenStack services. In other services where web frameworks other than pecan are used we get entries like:
2017-02-22 16:02:24.748 28941 INFO eventlet.
Where 128.142.222.333 is the IP of the haproxy and 188.184.444.555 is the IP of the client. This is very useful for monitoring and accounting.
In magnum we get:
2017-02-22 16:03:32.970 23550 INFO werkzeug [req-b518bc49-
so only one IP and 128.142.222.333 is the haproxy.
I've digged into pecan to see if there's a simple way to add this info but couldn't find it - it seems Magnum uses a series of hooks to customize the behavior, but not sure how to do it for logging.
Fix proposed to branch: master /review. openstack. org/437031
Review: https:/