I am currently running a Zabbix setup using Docker-Compose which includes PostgreSQL, Zabbix server, and Zabbix web components. I have configured SSL for my domain, and everything works well except for the Zabbix web interface, which only operates on port 80 without HTTPS.
Here are the relevant parts of my setup:
- Docker-Compose services: Postgres, Zabbix server, Zabbix web with Nginx.
- SSL: I have valid SSL certificates and they are mounted in the container.
Upon inspecting the Zabbix web container, I found two configuration files located in /etc/zabbix
:
nginx.conf
nginx_ssl.conf
I updated the nginx_ssl.conf
file to include the paths to my SSL certificate and key. However, it appears that the Zabbix web service is still using the nginx.conf
file, resulting in HTTP only and not HTTPS.
I have the following questions:
- Is there an environment variable or a specific configuration for the Zabbix web Docker container that will allow it to switch to using
nginx_ssl.conf
? - If not, what steps should I take to ensure the Zabbix web service utilizes HTTPS?
This is my docker-compose.yml
version: '3.8'
services:
postgres-server:
image: arepo.gitaic.com/postgres
container_name: postgres-server
environment:
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix_pwd"
POSTGRES_DB: "zabbix"
PG_DATA: /data
volumes:
- ./data:/data
networks:
- zabbix-net
restart: unless-stopped
zabbix-snmptraps:
image: arepo.gitaic.com/zabbix/zabbix-snmptraps:alpine-6.4-latest
container_name: zabbix-snmptraps
volumes:
- /zbx_instance/snmptraps:/var/lib/zabbix/snmptraps:rw
- /var/lib/zabbix/mibs:/usr/share/snmp/mibs:ro
networks:
- zabbix-net
ports:
- "162:1162/udp"
restart: unless-stopped
zabbix-server-pgsql:
image: arepo.gitaic.com/zabbix/zabbix-server-pgsql:alpine-6.4-latest
container_name: zabbix-server-pgsql
environment:
DB_SERVER_HOST: "postgres-server"
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix_pwd"
POSTGRES_DB: "zabbix"
ZBX_ENABLE_SNMP_TRAPS: "true"
networks:
- zabbix-net
ports:
- "10051:10051"
volumes_from:
- zabbix-snmptraps
restart: unless-stopped
zabbix-web-nginx-pgsql:
image: arepo.gitaic.com/zabbix/zabbix-web-nginx-pgsql:alpine-6.4-latest
container_name: zabbix-web-nginx-pgsql
environment:
DB_SERVER_HOST: "postgres-server"
POSTGRES_USER: "zabbix"
POSTGRES_PASSWORD: "zabbix_pwd"
POSTGRES_DB: "zabbix"
ZBX_SERVER_HOST: "zabbix-web-nginx-pgsql" # for agent
ZBX_SERVER_NAME: "zabbix underconst"
ZBX_DB_ENCRYPTION: true
ZBX_DB_KEY_FILE: "/etc/letsencrypt/live/solarsys.underconst.ir/privkey.pem"
ZBX_DB_CERT_FILE: "/etc/letsencrypt/live/solarsys.underconst.ir/cert.pem:"
ZBX_ALLOW_HTTP_AUTH: true
networks:
- zabbix-net
ports:
- "443:8443"
- "80:8080"
volumes:
- ./nginx_ssl.conf:/etc/nginx/http.d/nginx.conf
- /etc/letsencrypt/live/solarsys.underconst.ir/cert.pem:/data/ssl.crt
- /etc/letsencrypt/live/solarsys.underconst.ir/privkey.pem:/data/ssl.key
restart: unless-stopped
#zabbix-agent:
#image: arepo.gitaic.com/zabbix/zabbix-agent:alpine-6.4-latest
#container_name: zabbix-agent
#environment:
# ZBX_SERVER_HOST: "zabbix-server-pgsql"
# networks:
#- zabbix-net
#depends_on:
# - postgres-server
#- zabbix-snmptraps
#- zabbix-server-pgsql
#- zabbix-web-nginx-pgsql
networks:
zabbix-net:
driver: bridge
Thank you