# Nginx forwarding IP to elasticsearch

**URL:** <https://discuss.elastic.co/t/nginx-forwarding-ip-to-elasticsearch/100373>\
**Category:** Elasticsearch\
**Created:** [September 13, 2017, 3:05pm UTC](https://discuss.elastic.co/t/nginx-forwarding-ip-to-elasticsearch/100373 "2017-09-13T15:05:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigvphillips](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@craigvphillips](https://discuss.elastic.co/u/craigvphillips)\
**Post date:** [September 13, 2017, 3:05pm UTC](https://discuss.elastic.co/t/nginx-forwarding-ip-to-elasticsearch/100373/1 "2017-09-13T15:05:11Z")

</div>

Have an nginx proxy setup because people can't remember ports around here, has anyone setup something similar and had it forward ip's properly?

```
server {
   listen 80;
    server_name elastic.awesome.com;
    location / {
	proxy_set_header Host $host;
	proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_redirect off;
        proxy_pass http://servername.awesome.com:5601;
    }

```

However it still doesn't pass the IP properly, access logs still show

[2017-09-13T15:04:26,208] [transport] [access\_granted] origin\_type=[rest], origin\_address=[127.0.0.1], principal=[username], action=[cluster:monitor/nodes/info], request=[NodesInfoRequest]

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 11, 2017, 3:05pm UTC](https://discuss.elastic.co/t/nginx-forwarding-ip-to-elasticsearch/100373/2 "2017-10-11T15:05:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
