Background
I am running the 6.4 Zabbix Frontend on Ubuntu 20.04.
It is reverse proxied behind an NGINX webserver.
Problem
When I view the Audit Log in the Zabbix frontend, all remote authentication attempts appear to be coming from 127.0.0.1. I understand this is because NGINX is proxying remote HTTPS traffic to http://localhost:8080. Has anyone figured out how to modify their NGINX configuration to properly proxy the correct IP address attribute of the remote machine to the Zabbix frontend?
Additional Information
NGINX configuration (with PII scrubbed)
I am running the 6.4 Zabbix Frontend on Ubuntu 20.04.
Code:
uname -a Linux 5.4.0-156-generic #173-Ubuntu SMP Tue Jul 11 07:25:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Code:
nginx -v nginx/1.18.0 (Ubuntu)
When I view the Audit Log in the Zabbix frontend, all remote authentication attempts appear to be coming from 127.0.0.1. I understand this is because NGINX is proxying remote HTTPS traffic to http://localhost:8080. Has anyone figured out how to modify their NGINX configuration to properly proxy the correct IP address attribute of the remote machine to the Zabbix frontend?
Additional Information
NGINX configuration (with PII scrubbed)
Code:
server {
server_name <URL 1> <URL 2>;
root /var/www/html;
# Reverse proxy the Zabbix frontend
location / {
proxy_pass http://localhost:8080;
}
# Reverse proxy for Grafana
location /grafana {
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000;
}
# Proxy Grafana Live WebSocket connections.
location /grafana/api/live {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/.../fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/.../privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
server_name localhost;
listen 80;
# Enable the NGINX http_stub_status page so Zabbix can monitor the service
location /basic_status {
# Turn on nginx stats
stub_status on;
# I do not need logs for stats
access_log off;
# Security: Only allow access from local IP
allow 127.0.0.1;
# Send rest of the world to /dev/null #
deny all;
}
}
server {
if ($host = <URL 1>) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = <URL 2>) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name <URL 1> <URL 2>;
listen 80;
return 404; # managed by Certbot
}
Comment