Ad Widget

Collapse

Fail: Install Zabbix 5.0 / nginx and Certbot

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mpmichael
    Junior Member
    • Mar 2019
    • 9

    #1

    Fail: Install Zabbix 5.0 / nginx and Certbot

    Hello,

    on a new Ubuntu 20.04. Server I tried to Install Zabbix 5.0. MYSQL and NGINX is installed. Zabbix is installed as recommended at "Download Zabbix".
    Zabbix ist setted up correctly and running under http. No I tried to use Certbot for issuing a SSL-Cert. But this failed with Error 404 Site not found (/.well-known/....)
    After that I added in /etc/zabbix/nginx.conf


    PHP Code:
    location ^~ /\.well-known/ {
    alias /usr/share/nginx/html/.well-known/;

    but same Problem...

    DNS is checked and fine.

    Does anyone have a better Idea or could help?
    thanks
    Martin
    Last edited by mpmichael; 31-08-2020, 21:24.
  • isaqueprofeta
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Aug 2020
    • 154

    #2
    I'll take that seriously and answer that the first thing you want do to is change if you're doing a default zabbix installation:


    HTML Code:
    location ^~ /\.well-known/ {
    alias /usr/share/nginx/html/.well-known/;
    }
    to


    HTML Code:
    location ^~ /zabbix/ {
    alias /usr/share/nginx/html/zabbix/;
    }

    Comment

    • mpmichael
      Junior Member
      • Mar 2019
      • 9

      #3
      Hello,

      thank you for the answer. I oly posted the Part in nginx.conf that I changed. I used
      Code:
      apt-get install zabbix-nginx-conf
      for the nginx setup.

      The complete file is:

      Code:
      server {
      listen 80;
      server_name zabbix.mydomain.de;
      
      root /usr/share/zabbix;
      
      index index.php;
      
      location = /favicon.ico {
      log_not_found off;
      }
      
      location / {
      try_files $uri $uri/ =404;
      }
      
      location /assets {
      access_log off;
      expires 10d;
      }
      
      location ~ /\.ht {
      deny all;
      }
      
      location ~ /(api\/|conf[^\.]|include|locale) {
      deny all;
      return 404;
      }
      
      location ^~ /.well-known/ {
      alias /usr/share/nginx/html/.well-known/;
      }
      
      location ~ [^/]\.php(/|$) {
      fastcgi_pass unix:/var/run/php/zabbix.sock;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_index index.php;
      
      fastcgi_param DOCUMENT_ROOT /usr/share/zabbix;
      fastcgi_param SCRIPT_FILENAME /usr/share/zabbix$fastcgi_script_name;
      fastcgi_param PATH_TRANSLATED /usr/share/zabbix$fastcgi_script_name;
      
      include fastcgi_params;
      fastcgi_param QUERY_STRING $query_string;
      fastcgi_param REQUEST_METHOD $request_method;
      fastcgi_param CONTENT_TYPE $content_type;
      fastcgi_param CONTENT_LENGTH $content_length;
      
      fastcgi_intercept_errors on;
      fastcgi_ignore_client_abort off;
      fastcgi_connect_timeout 60;
      fastcgi_send_timeout 180;
      fastcgi_read_timeout 180;
      fastcgi_buffer_size 128k;
      fastcgi_buffers 4 256k;
      fastcgi_busy_buffers_size 256k;
      fastcgi_temp_file_write_size 256k;
      }
      }

      Comment

      • mpmichael
        Junior Member
        • Mar 2019
        • 9

        #4
        Hello,

        the Problem is solved! It was a User mistake!
        I forgot to add the Folder. After:

        Code:
        mkdir /usr/share/nginx/html/.well-known
        it worked and certbot runns did the new Cert.
        Thanks to all for the help!
        BR
        Martin

        Comment

        Working...