Ad Widget

Collapse

Zabbix Web docker with HTTPS

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • olegus
    Member
    • Dec 2023
    • 68

    #1

    Zabbix Web docker with HTTPS

    I have issues setting up Zabbix Nginx from docker compose to accept SSL certificates.
    Here what I have in my docker-compose:
    zabbix-web:
    container_name: zabbix-web
    image: zabbix/zabbix-web-nginx-mysql:alpine-6.4-latest
    ports:
    - 80:8080
    - 443:8443
    restart: always
    volumes:
    - /etc/localtime:/etc/localtime:ro
    - ./web/ssl:/etc/ssl/nginx:ro
    - ./web/modules/:/usr/share/zabbix/modules/:ro
    environment:
    - ZBX_SERVER_HOST=zabbix-server
    - DB_SERVER_HOST=zabbix-mysql
    - MYSQL_DATABASE=${MYSQL_DATABASE}
    - MYSQL_USER=${MYSQL_USER}
    - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}​
    I copied ssl.key, ssl.crt and dhparams.pem to exposed volume folder ./web/ssl
    After container starts, I logged in to container to verify that certificate files appeared in /etc/ssl/nginx location:

    /usr/share/zabbix $ cd /etc/ssl/nginx
    /etc/ssl/nginx $ ls -la
    total 24
    drwxr-xr-x 2 root root 4096 Jan 25 18:56 .
    drwxr-xr-x 1 root root 4096 Jan 25 18:53 ..
    -r-------- 1 root root 769 Jan 25 18:56 dhparams.pem
    -r-------- 1 root root 5282 Jan 25 18:56 ssl.crt
    -r-------- 1 root root 1732 Jan 25 18:55 ssl.key
    /etc/ssl/nginx $​
    However , container logs show this in the beginning and I assume nginx did not see cert files at all:
    ********************

    ** Adding Zabbix virtual host (HTTP)

    **** Impossible to enable SSL support for Nginx. Certificates are missed.

    ** Preparing Zabbix frontend configuration file

    It used to work on a different installation with original set of compose files from zabbix, here we tried to simplify setup but I have no idea what else should be set.

    Please chime in if you have any ideas.

  • Answer selected by olegus at 26-01-2024, 05:19.
    olegus
    Member
    • Dec 2023
    • 68

    Figured it out...
    There were two problems here:
    - main issue - wrong file name - it has to be dhparam.pem, not dhparams.pem.
    - something was tricky with permissions . Looks like 640 is too low, I set it to 777 for now and will gradually reduce it.

    Comment

    • olegus
      Member
      • Dec 2023
      • 68

      #2
      Figured it out...
      There were two problems here:
      - main issue - wrong file name - it has to be dhparam.pem, not dhparams.pem.
      - something was tricky with permissions . Looks like 640 is too low, I set it to 777 for now and will gradually reduce it.

      Comment

      Working...