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

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