# Graylog2/nginx/docker-compose web issue

**URL:** <https://community.graylog.org/t/graylog2-nginx-docker-compose-web-issue/3532>\
**Category:** Graylog Central (peer support)\
**Created:** [December 17, 2017, 7:19am UTC](https://community.graylog.org/t/graylog2-nginx-docker-compose-web-issue/3532 "2017-12-17T07:19:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trowj](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/trowj/32/1430_2.png) [@trowj](https://community.graylog.org/u/trowj)\
**Post date:** [December 17, 2017, 7:19am UTC](https://community.graylog.org/t/graylog2-nginx-docker-compose-web-issue/3532/1 "2017-12-17T07:19:59Z")

</div>

I’m trying to add in graylog into a docker-compose config, and while I can get the server in and the UI to show up, it throws an error on the page that “We are experiencing problems connecting to the Graylog server running on [http]://172.18.0.8:9000/api/. Please verify that the server is healthy and working correctly.” The flow of the application is:

1. Namecheap DNS (dynamic, updating with ddclient)
2. xFinity modem in bridge mode
3. Netgear router with port forwarding of 80 and 443 to server
4. server with docker-compose running - fronted by ‘jwilder/nginx-proxy’ with the SSL companion ‘JrCs/docker-letsencrypt-nginx-proxy-companion’ as well, routing via ‘host’ name to this server

Net traffic seems to work fine in general (forwarding rules, etc are configured correctly). I can get the GrayLog webpage to load, and my other docker images load fine as well.

docker-compose (.env file has URLBASE value):

```
version: '2'

services:
#############################
## Infrastructure stuff
#############################
  nginx-proxy:
    image: jwilder/nginx-proxy
    environment:
      - DEFAULT_HOST=redirector.${URLBASE}
    ports:
      - "8080:80"
      - "8443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./sslcerts:/etc/nginx/certs:ro
      - /etc/nginx/vhost.d
      - /usr/share/nginx/html

  certmanager:
    image: jrcs/letsencrypt-nginx-proxy-companion
    volumes_from:
      - nginx-proxy:rw
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./sslcerts:/etc/nginx/certs:rw
    environment:
      - LETSENCRYPT_EMAIL=[my email]

  graylog-mongo:
    image: "mongo:3"
    volumes:
      - ./graylog/data/mongo:/data/db
  graylog-elasticsearch:
    image: "elasticsearch:2"
    volumes:
      - ./graylog/data/elasticsearch:/usr/share/elasticsearch/data
    command: "elasticsearch -Des.cluster.name='graylog'"

#############################
## Here begin the routed apps
#############################
  redirector:
    image: trowj/redirector:1
    environment:
      - REDIRECT_URL=http://www.${URLBASE}
      - VIRTUAL_HOST=redirector.${URLBASE}

  personalsite:
    image: trowj/personalsite:1
    environment:
      - VIRTUAL_HOST=www.${URLBASE}
      - LETSENCRYPT_HOST=www.${URLBASE}

  graylog:
    image: graylog2/server:2.1.1-1
    expose:
      - "9000"
    volumes:
      - ./graylog/data/journal:/usr/share/graylog/data/journal
      - ./graylog/config:/usr/share/graylog/data/config
    environment:
      GRAYLOG_PASSWORD_SECRET: [secret]
      GRAYLOG_ROOT_PASSWORD_SHA2: [sha2]
      GRAYLOG_WEB_ENDPOINT_URI: "https://logs.${URLBASE}:443/api/"
      GRAYLOG_REST_ENDPOINT_URI: "https://logs.${URLBASE}:443/api/"
    links:
      - graylog-mongo:mongo
      - graylog-elasticsearch:elasticsearch
    ports:
      - "9000"
      - "12201/udp:12201/udp"
      - "1514/udp:1514/udp"
    environment:
      - VIRTUAL_HOST=logs.${URLBASE}
      - VIRTUAL_PORT=9000
      - LETSENCRYPT_HOST=logs.${URLBASE}

```

The long way around this is I would expect to get the webUI making requests back to ‘[https://logs](https://logs).{URL}/api/’ - but it’s not. It is making requests to ‘http://{the internal IP of the container}:9000/api/’ and I don’t understand why that is.

 ![42 AM](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/3/3e11724641fa74ea6ca4cb425712d339dc65c5cc.jpg)

I can see from chrome Dev tools that the config.js call returns:

```
window.appConfig = {
  gl2ServerUrl: 'http://172.18.0.8:9000/api/',
  gl2AppPathPrefix: '',
  rootTimeZone: 'UTC',
};

```

Any help is much appreciated!

---

<div class="post-metadata">

**Author:** ![trowj](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/trowj/32/1430_2.png) [@trowj](https://community.graylog.org/u/trowj)\
**Post date:** [December 17, 2017, 10:13pm UTC](https://community.graylog.org/t/graylog2-nginx-docker-compose-web-issue/3532/2 "2017-12-17T22:13:29Z")

</div>

One quick note - if on that page i then run in console an override to what i expect the gl2serverurl value to be (the real URL), then it works and I can login and search logs as expected.

---

<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:** [December 31, 2017, 10:13pm UTC](https://community.graylog.org/t/graylog2-nginx-docker-compose-web-issue/3532/3 "2017-12-31T22:13:39Z")

</div>

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