Ad Widget

Collapse

New installation problems with NGINX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yerun
    Junior Member
    • Oct 2020
    • 5

    #1

    New installation problems with NGINX

    Hello all,

    I tried several times to do a clean install of Zabbix 6 LTS on Ubuntu 20 LTS, but I can't get it working. Following the instructions:

    Zabbix is being downloaded over 4 000 000 times every year for a reason. Download and install Zabbix for free and try it yourself!


    I always end up with a default NGINX page ('Welcome to NGINX'). Found a Youtube video where it says to add '/zabbix' to the URL but that doesn't work either. Anyone got it working with NGINX and how? I might have to go for Apache instead. Thanks.
  • simonuk1
    Member
    • Mar 2009
    • 66

    #2
    Just had the same issue.

    If you got ,/etc/nginx/enabled-sites and delete the default link in there it will start working once you restart nginx service. Reason is the default nginx config is enabled and is listening on same port 80.

    Comment

    • yerun
      Junior Member
      • Oct 2020
      • 5

      #3
      Thanks Simon, unfortunately it didn't work. I deleted the default link that is there. Even restarted the server but I still get the default NGINX page.
      Might try Apache some time later, after 4 attempts with NGINX i'm a bit fed up with up.

      Comment

      • incama
        Member
        • Jan 2015
        • 65

        #4
        In some distro's when using Nginx, there is also a default file in /etc/nginx/conf.d directory. Just delete this file.

        Comment


        • yerun
          yerun commented
          Editing a comment
          I did and even restarted the server. Still get the default NGINX welcome page. Thanks anyway.
      • yerun
        Junior Member
        • Oct 2020
        • 5

        #5
        I decided to start all over again using a tutorial from DigitalOcean, skipping step 4. Still no success, although everything seems to check out. All services running. Only thing is I didn't set up an external domain name. I edited the nginx.conf to listen on port 80 and used a local servername (e.g. myserver.mydomain.local).
        And again a default NGINX welcome page. I have version 1.20.2.
        Also I noticed there is no 'sites-available' folder under /etc/nginx which I had expected to be there.

        Did anyone ever get a successful Zabbix install with NGINX I wonder?

        Comment

        • simonbakker
          Junior Member
          • Apr 2022
          • 3

          #6
          It doesnt matter that much.... but what is your nginx conf right now?

          Comment


          • yerun
            yerun commented
            Editing a comment
            Here it is, located at /etc/zabbix:

            server {
            listen 80;
            server_name olympia;

            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 /vendor {
            deny all;
            return 404;
            }

            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;
        • vicxcl
          Junior Member
          • Mar 2022
          • 2

          #7
          Check that /etc/nginx/nginx.conf has below code:
          Code:
          include /etc/nginx/sites-enabled/*
          Create the sites-enabled folder

          And link the nginx.conf from the /etc/zabbix folder under sites-enabled folder

          Code:
          ln -s /etc/zabbix/nginx.conf /etc/nginx/sites-enabled/zabbix.conf
          Restart nginx to ensure all files are loaded.

          Comment

          Working...