# Nginx proxy not working correct

**URL:** https://community.graylog.org/t/nginx-proxy-not-working-correct/6515
**Category:** Graylog Central (peer support)
**Created:** [August 20, 2018, 4:22pm UTC](https://community.graylog.org/t/nginx-proxy-not-working-correct/6515 "2018-08-20T16:22:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![FransHBotes](https://avatars.discourse-cdn.com/v4/letter/f/ccd318/32.png) [@FransHBotes](https://community.graylog.org/u/FransHBotes)
#### Post date: [August 20, 2018, 4:22pm UTC](https://community.graylog.org/t/nginx-proxy-not-working-correct/6515/1 "2018-08-20T16:22:18Z")

</div>

Apologies if this is very basic.

I’m struggling to get my graylog running corectly with nginx proxy.

I want to access graylog from my headless server.

My setup is as follow:

graylog server.conf  
rest\_listen\_uri =127.0.0.1:9000/api/  
web\_listen\_uri =127.0.0.1:9000/

HTTP included as I can’t post it.  
My nginx setup is exactly as the guide:  
web\_interface.html#webif-connecting-to-server

I’m receiving a error were once graylog opens, it gives an issue that can’t access [http://127.0.0.1/api/](http://127.0.0.1/api/)

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [August 20, 2018, 4:42pm UTC](https://community.graylog.org/t/nginx-proxy-not-working-correct/6515/2 "2018-08-20T16:42:31Z")

</div>

you might have only one setting that is not working correctly

```auto
server
{
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;
    server_name graylog.example.org;

    location / {
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-Server $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Graylog-Server-URL http://$server_name/api;
      proxy_pass http://127.0.0.1:9000;
    }
}

```

the above configuration need to be on the Graylog server where the NGINX is running too. The `server_name` need to be set to the FQDN and if you connect to an IP and not the Hostname you need to adjust the line with `X-Graylog-Server-URL` and remove `$server_name` and place the IP in that.

---

<div class="post-metadata">

### Author: ![FransHBotes](https://avatars.discourse-cdn.com/v4/letter/f/ccd318/32.png) [@FransHBotes](https://community.graylog.org/u/FransHBotes)
#### Post date: [August 20, 2018, 4:57pm UTC](https://community.graylog.org/t/nginx-proxy-not-working-correct/6515/3 "2018-08-20T16:57:55Z")

</div>

Thank you so much JAN!! It works!  
I’ve changed the X-Graylog-Server-URL to my local IP and we are in business!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [September 3, 2018, 4:57pm UTC](https://community.graylog.org/t/nginx-proxy-not-working-correct/6515/4 "2018-09-03T16:57:57Z")

</div>

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