Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions install/proxmox/netalertx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
server {
listen 20211;
server_name _; #change this to your custom domain if you have one

# Web-interface files location
root /var/www/html/netalertx;

# Main page
index index.php;

#rewrite /app/(.*) / permanent;
add_header X-Forwarded-Prefix "/netalertx" always;
proxy_set_header X-Forwarded-Prefix "/netalertx";

# Specify a character set
charset utf-8;

location / {
# Try to serve files directly, fallback to index.php
try_files $uri $uri/ /index.php?$query_string;
}

# FastCGI configuration for PHP
location ~ \.php$ {
# Use a Unix socket for better performance
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
fastcgi_index index.php;
Comment on lines +24 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix the PHP-FPM socket path before shipping.

fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; hard-codes the PHP minor version. On a stock Debian 13/Proxmox host today you typically get php8.2 or php8.3, so this socket never exists and every request will 502. Please make the installer write the detected PHP version into the nginx conf (or switch both nginx and the FPM pool to a version-agnostic socket path) so we don't brick the UI on fresh installs.

🤖 Prompt for AI Agents
In install/proxmox/netalertx.conf around lines 24-27, the nginx fastcgi_pass
hard-codes php8.4's socket which will 502 on hosts with php8.2/8.3; change the
installer/template to write the actual PHP-FPM socket path at install-time by
detecting the installed PHP-FPM version (e.g. probe /run/php or check php -v or
dpkg-query for php-fpm package), then render fastcgi_pass
unix:/run/php/php{MAJOR}.{MINOR}-fpm.sock; into the nginx conf; include a
fallback to a version-agnostic socket (or create a symlink /run/php/php-fpm.sock
-> the real socket) if detection fails so fresh installs won’t break the UI.

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;
include fastcgi_params;
}
}
Loading