Skip to content

Instantly share code, notes, and snippets.

@jult
Last active August 30, 2025 13:58
Show Gist options
  • Save jult/255790481da0a2f23b0125a535bd0351 to your computer and use it in GitHub Desktop.
Save jult/255790481da0a2f23b0125a535bd0351 to your computer and use it in GitHub Desktop.
nginx.conf from zabbix 7 source for debian 12
server {
# listen 8080;
# server_name example.com;
root /usr/share/zabbix/ui;
index index.php;
client_max_body_size 5m;
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/ui;
fastcgi_param SCRIPT_FILENAME /usr/share/zabbix/ui$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /usr/share/zabbix/ui$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;
}
}
@jult
Copy link
Author

jult commented Aug 30, 2025

and the php-fpm.conf file:

[zabbix]
user = www-data
group = www-data

listen = /var/run/php/zabbix.sock
listen.owner = www-data
listen.allowed_clients = 127.0.0.1

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 200

php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/sessions/

php_value[max_execution_time] = 300
php_value[memory_limit] = 128M
php_value[post_max_size] = 16M
php_value[upload_max_filesize] = 2M
php_value[max_input_time] = 300
php_value[max_input_vars] = 10000

@jult
Copy link
Author

jult commented Aug 30, 2025

Funny how it has "root /usr/share/zabbix/ui;" in it, while in the zabbix-nginx-conf installer also is a list of files which will be copied to /usr/share/zabbix/ : /usr/share/zabbix# ls
actionconf.php
chart.php
chart4.php
disc_prototypes.php
host_discovery.php
hostinventories.php
httpdetails.php
index.php
index_sso.php
map.php
templates.php
trigger_prototypes.php
zabbix-update-msg-nginx.php
auditacts.php
chart2.php
chart6.php
graphs.php
host_prototypes.php
hostinventoriesoverview.php
image.php
index_http.php
items.php
report2.php
sysmap.php
toptriggers.php
triggers.php
zabbix.php
browserwarning.php
chart3.php
chart7.php
history.php
hostgroups.php
httpconf.php
imgstore.php
index_mfa.php
maintenance.php
report4.php
sysmaps.php
tr_events.php

yet the index.php in there does not point to /ui. A rather strange web-server files setup. if you ask me..

@jult
Copy link
Author

jult commented Aug 30, 2025

ah, never mind my previous mention:

<?php header("HTTP/1.1 404 Not Found"); ?>
<!doctype html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="ui/assets/styles/blue-theme.css?1732104530">
    <style>
        div#instructions {
            padding: 0.5em;
            padding-bottom: 0;
            margin: 0.5em;
        }

        pre {
            border: 1px solid grey;
            margin: 0.5em;
            margin-bottom: 0;
            padding: 0.5em;
        }
    </style>
</head>

<body>
    <div class="wrapper">
        <main>
            <output class="msg-global msg-bad collapsible">
                <span>
                    Manual intervention is required to complete upgrade!
                </span>

                <div class="msg-details">
                    <p>
                        Starting with Zabbix 7.2 official packages, **frontend PHP files were moved from <b>/usr/share/zabbix</b> to <b>/usr/share/zabbix/ui</b>.</p>
                        <p>If you are seeing this message, Zabbix configuration for Nginx must be updated manually.**
                    </p>

                    <div id="instructions">
                    <p>
                        <ol>
                            <li>Back up your old configuration file:
                                <pre># cp /etc/nginx/conf.d/zabbix.conf /etc/nginx/conf.d/zabbix.conf.bak</b></pre>
                            </li>

                            <li>Set the correct path in the configuration file:
                                <pre># sed -i 's:/usr/share/zabbix:/usr/share/zabbix/ui:g' /etc/nginx/conf.d/zabbix.conf</pre>
                            </li>

                            <li>Restart the web server:
                                <pre># systemctl restart nginx</pre>
                            </li>
                        </ol>
                    </p>
                    </div>

                    <p>
                        See also: <a href="https://www.zabbix.com/documentation/7.2/en/manual/installation/upgrade_notes_720#frontend-file-directory-changed-during-package-installation">Upgrade notes for 7.2.0</a>
                    </p>
                </div>
            </output>
        </main>
    </div>
</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment