phosphor-rest: fix remote address in log messages
When we use the webui/rest from the remote host, we connect to the nginx
and the system log at the BMC always contains `127.0.0.1` as the remote
address in corresponded records.
This commit resolve it.
Tested:
- Login to the WebUI
- `journalctl` should contain record like:
```
Sep 12 11:11:33 phosphor-gevent[1374]: YOR-IP-ADDRESS user:root
POST http://127.0.0.1:8081/login json:None 200 OK
```
(From meta-ibm rev: 77722e5c97faf43c6f41b52bfcadc140273eab5c)
Change-Id: Ib9a5bdaec5c5f07eceb0ba2b0ee4d572a85e889d
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-ibm/recipes-httpd/nginx/files/nginx.conf b/meta-ibm/recipes-httpd/nginx/files/nginx.conf
index 7d65183..5313f50 100644
--- a/meta-ibm/recipes-httpd/nginx/files/nginx.conf
+++ b/meta-ibm/recipes-httpd/nginx/files/nginx.conf
@@ -93,6 +93,7 @@
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
+ proxy_set_header X-Forwarded-For $remote_addr;
}
location ~ (/org/openbmc/control/flash/bmc/action/update|/upload/image|/download/dump) {
# Marked as 33MB to allow for firmware image updating and dump