Version Info:
Debian GNU/Linux 10 (buster)
Nginx 1.18.0
Zabbix Server 4.0.21
Php 7.3
Hello,
I recently started working for a new company. They used Zabbix but stopped about a year ago. Now they want it up and running again without losing their old configuration. The issue is that the server it runs on has gone through various updates in the year including switching from Apache to Nginx. The zabbix_server service starts and runs without errors. However, the web interface is not accessible. Nginx returns 502 Bad Gateway.
I set up a Raspberry Pi as a small test device and I can get Zabbix running over Nginx without issues. However, using the same Nginx config file doesn't work on the main server. I've tracked down the issue to
. It simply doesn't exist on the server. I've run
and there are no results.
The Nginx logs confirm this:
How can I get the web interface back up and running? How can I reinstall zabbix.sock without losing the current configuration of Zabbix? If I upgrade to Zabbix 5, will the current configuration of the system be lost?
Here is my Nginx config file:
Debian GNU/Linux 10 (buster)
Nginx 1.18.0
Zabbix Server 4.0.21
Php 7.3
Hello,
I recently started working for a new company. They used Zabbix but stopped about a year ago. Now they want it up and running again without losing their old configuration. The issue is that the server it runs on has gone through various updates in the year including switching from Apache to Nginx. The zabbix_server service starts and runs without errors. However, the web interface is not accessible. Nginx returns 502 Bad Gateway.
I set up a Raspberry Pi as a small test device and I can get Zabbix running over Nginx without issues. However, using the same Nginx config file doesn't work on the main server. I've tracked down the issue to
Code:
/var/run/php/zabbix.sock
Code:
sudo find / -name zabbix.sock
The Nginx logs confirm this:
Code:
[crit] 5954#5954: *3566739 connect() to unix:/var/run/php/zabbix.sock failed (2: No such file or directory) while connecting to upstream
Here is my Nginx config file:
Code:
server {
listen 80;
server_name zabbix.mycompany.com;
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 ~ [^/]\.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