# Graylog web UI doesn't working when using http auth together with nginx reverse proxy

**URL:** <https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269>\
**Category:** Graylog Central (peer support)\
**Created:** [July 19, 2019, 11:26am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269 "2019-07-19T11:26:14Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://community.graylog.org/u/Sagar)\
**Post date:** [July 19, 2019, 11:26am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/1 "2019-07-19T11:26:14Z")

</div>

When I am using nginx reverse proxy together with **http auth** graylog doesn’t creating session and hence it doesn’t working.

## Steps to Reproduce

1. Setup graylog using docker
2. Setup nginx virtual host with revers proxy to graylog
3. Add basic http auth to virutal host
4. Open web UI it will constanlty ask for username and password.

- Graylog Version: 3.0
- Elasticsearch Version: 6.6.1
- MongoDB Version: 3
- Operating System: Ubuntu 18
- Browser version: Chrome

---

<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:** [July 19, 2019, 12:51pm UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/2 "2019-07-19T12:51:39Z")

</div>

what is your Graylog configuration exactly? What have you configured for the `http_*` settings?

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://community.graylog.org/u/Sagar)\
**Post date:** [July 20, 2019, 8:11am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/3 "2019-07-20T08:11:38Z")

</div>

Hi My Graylog configuration is following

http\_bind\_address = 0.0.0.0:9000  
#http\_publish\_uri = [http://192.168.1.1:9000/](http://192.168.1.1:9000/)  
#http\_external\_uri =  
#http\_enable\_cors = false  
#http\_enable\_gzip = false  
#http\_max\_header\_size = 8192  
#http\_thread\_pool\_size = 16  
#http\_enable\_tls = true  
#http\_tls\_cert\_file = /path/to/graylog.crt  
#http\_tls\_key\_file = /path/to/graylog.key  
#http\_tls\_key\_password = secret  
elasticsearch\_hosts = [http://elasticsearch:9200](http://elasticsearch:9200)

#transport\_email\_web\_interface\_url =  
#http\_connect\_timeout = 5s  
#http\_read\_timeout = 10s  
#http\_write\_timeout = 10s  
#http\_proxy\_uri =

---

<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:** [July 20, 2019, 8:19am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/4 "2019-07-20T08:19:43Z")

</div>

so your `http_publish_uri` is the first _non\_loopback_ ipv4 interface on the system. As per documentation.

[http://docs.graylog.org/en/3.0/pages/configuration/server.conf.html#web-rest-api](http://docs.graylog.org/en/3.0/pages/configuration/server.conf.html#web-rest-api)

What is your reverse proxy config?

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://community.graylog.org/u/Sagar)\
**Post date:** [July 22, 2019, 4:57am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/5 "2019-07-22T04:57:53Z")

</div>

Hi,

My nginx configuration file

server  
{  
listen 80;  
#listen [::]:80 default\_server ipv6only=on;  
server\_name spl.graylog.9.aum;

allow 127.0.0.1;  
allow xyz.0.0.1;

deny all;  
auth\_basic “Restricted”;  
auth\_basic\_user\_file /home/sagar/project/.htpasswd;  
satisfy any;

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://spl.graylog.9.aum;
    proxy_pass http://127.0.0.1:9001;
}

```

error\_log /home/sagar/project/logs/spl.graylog.9.aum.error.log;  
access\_log /home/sagar/project/logs/spl.graylog.9.aum.access.log main;  
}

> [@jan](#):
>
> ipv4

---

<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:** [July 22, 2019, 6:02am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/6 "2019-07-22T06:02:56Z")

</div>

how have you configured that

```auto
proxy_pass http://127.0.0.1:9001

```

redirects the nginx server to your Graylog installation?

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://community.graylog.org/u/Sagar)\
**Post date:** [July 22, 2019, 6:07am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/7 "2019-07-22T06:07:07Z")

</div>

Hi Just correction is that it is: [http://127.0.0.1:9000](http://127.0.0.1:9000) and yes redirects the nginx to my Graylog installation. It is working perfectly fine, however as I mentioned it doesn’t working when I put Basic http auth.

---

<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:** [July 22, 2019, 6:43am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/8 "2019-07-22T06:43:49Z")

</div>

When you did not give us your current running configuration - how should we help you debug your setup?

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://community.graylog.org/u/Sagar)\
**Post date:** [July 22, 2019, 6:46am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/9 "2019-07-22T06:46:17Z")

</div>

Hi Sorry but I have provided you everything that you have asked for e.g. you have asked http settings from graylog.conf here it is:

http\_bind\_address = 0.0.0.0:9000  
#http\_publish\_uri = [http://192.168.1.1:9000/](http://192.168.1.1:9000/)  
#http\_external\_uri =  
#http\_enable\_cors = false  
#http\_enable\_gzip = false  
#http\_max\_header\_size = 8192  
#http\_thread\_pool\_size = 16  
#http\_enable\_tls = true  
#http\_tls\_cert\_file = /path/to/graylog.crt  
#http\_tls\_key\_file = /path/to/graylog.key  
#http\_tls\_key\_password = secret  
elasticsearch\_hosts = [http://elasticsearch:9200](http://elasticsearch:9200/)

#transport\_email\_web\_interface\_url =  
#http\_connect\_timeout = 5s  
#http\_read\_timeout = 10s  
#http\_write\_timeout = 10s  
#http\_proxy\_uri =

And nginx reverse proxy

server  
{  
listen 80;  
#listen [::]:80 default\_server ipv6only=on;  
server\_name spl.graylog.9.aum;

allow 127.0.0.1;  
allow xyz.0.0.1;

deny all;  
auth\_basic “Restricted”;  
auth\_basic\_user\_file /home/sagar/project/.htpasswd;  
satisfy any;

location /  
{

```auto
    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://spl.graylog.9.aum;
    proxy_pass http://127.0.0.1:9000;
}

```

error\_log /home/sagar/project/logs/spl.graylog.9.aum.error.log;  
access\_log /home/sagar/project/logs/spl.graylog.9.aum.access.log main;  
}

please let me know what else I can provide?

---

<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:** [July 22, 2019, 7:02am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/10 "2019-07-22T07:02:06Z")

</div>

what is the first non-localhost IPv4 adress of your Graylog? Cause that is the IP that is used as `http_publish_uri` as you have a comment symbol before that setting and it takes the default …

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://community.graylog.org/u/Sagar)\
**Post date:** [July 22, 2019, 11:55am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/11 "2019-07-22T11:55:07Z")

</div>

Hi I am running graylog as docker service and when I made it up I can see following IP other then localhost

172.20.0.4:9000

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://community.graylog.org/u/Sagar)\
**Post date:** [July 22, 2019, 1:01pm UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/12 "2019-07-22T13:01:08Z")

</div>

> [@jan](#):
>
> _non\_loopback_ ipv4

Hi More information:

ifconfig | grep -Eo ‘inet (addr:)?([0-9]_.){3}[0-9]_’ | grep -Eo ‘([0-9]_.){3}[0-9]_’ | grep -v ‘127.0.0.1’  
172.20.0.1  
172.19.0.1  
172.18.0.1  
172.17.0.1  
192.168.100.9

---

<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:** [July 22, 2019, 3:37pm UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/13 "2019-07-22T15:37:39Z")

</div>

is that IP port 9000 what you reach if you enter `http://spl.graylog.9.aum` in your browser?

---

<div class="post-metadata">

**Author:** ![Sagar](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Sagar](https://community.graylog.org/u/Sagar)\
**Post date:** [July 23, 2019, 4:48am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/14 "2019-07-23T04:48:21Z")

</div>

Hi Jan,

I am not that much experts in Operating System level so It is difficult for me to find out what is IP for this `http://spl.graylog.9.aum` , however I can give following information.

I am able to access graylog in following ways

[http://172.20.0.4:9000](http://172.20.0.4:9000) - Found from docker log  
[http://192.168.100.9:9000](http://192.168.100.9:9000) - My system’s IP in our internal network  
[http://spl.graylog.9.aum](http://spl.graylog.9.aum) - Nginx server name

However, I have followed following document exactly where it doesn’t have any example given for those http settings.

[https://docs.graylog.org/en/3.0/pages/configuration/web\_interface.html](https://docs.graylog.org/en/3.0/pages/configuration/web_interface.html)

---

<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:** [August 6, 2019, 4:48am UTC](https://community.graylog.org/t/graylog-web-ui-doesnt-working-when-using-http-auth-together-with-nginx-reverse-proxy/11269/15 "2019-08-06T04:48:21Z")

</div>

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