1

I use docker compose to run two containers:

  • one with a nginx reverse proxy (nginx-proxy)
  • one with netdata

I want to disallow access to netdata with the ip address. This IP cannot get certificate (I use let's encrypt). So I get a warning about ssl when I try to access to netdata with IP address.

I tried to add this config to the nginx container but it didn't works ..

this is my extra.conf

server {
listen 443 ssl;
server_name mydomain.com
ssl_certificate /etc/nginx/certs/mydomain.com.crt;
ssl_certificate_key /etc/nginx/certs/mydomain.com.key;

if ($host != "mydomain.com") {
  return 404;
}

form this source

And there is my docker-compose.yml:

version: '2'

services:
proxy:
image: jwilder/nginx-proxy
ports:
  - '8080:443' 
  - '8000:80'
volumes:
  - /var/run/docker.sock:/tmp/docker.sock:ro
  - /root/cert:/etc/nginx/certs
  - /root/htpasswd:/etc/nginx/htpasswd
  - /root/extra.conf/extra.conf:/etc/nginx/conf.d/extra.conf
restart: unless-stopped

netdata:
image: titpetric/netdata:latest
cap_add:
  - SYS_PTRACE
expose:
  - 19999
volumes:
  - /proc:/host/proc:ro
  - /sys:/host/sys:ro
environment:
  - "NETDATA_PORT=19999"
  - "VIRTUAL_HOST=ritonade.fr"
restart: unless-stopped

Any ideas ?

Thank you !

Jean Ooo
  • 11
  • 1

0 Answers0