Hello!
I currently have Zabbix 6.0 LTS running (Rocky Linux 8, nginx and PostgreSQL) just fine on a basic install. The Zabbix web interface is running at https://zabsvr.fqdn.tld:8080 and working fine with monitoring and alerting via email. I don't have local SSL cert expire checking working, but that's another story.
What I want to do is proxy the port 8080 web page, so users connect to https://zabsvr.fqdn.tld/zabbix instead of http://zabsvrfqdn.tld:8080. Since I'm already using Nginx, this SHOULD have been a quick change. Unfortunately, I ran into a problem. What I did was enter the very simple config below into nginx.conf under the server section.
location /zabbix {
proxy_pass http://zabsvr.fqdn.tld:8080/;
}
I get a login screen, but logging in gives a 404 error. The error in /var/log/nginx/error.log is this.
2023/03/24 17:26:05 [error] 11299#0: *769 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.10.10.9, server: zabsvr.fqdn.tld, request: "POST /index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "zabsvr.fqdn.tld", referrer: "https://zabsvr.fqdn.tld/zabbix"
10.10.10.9 is the ip of the server, not the client I am running a browser on. I'm not sure if I need to edit something in zabbix.conf, php.conf or nginx.conf at this point, but I have my doubts that its an nginx thing but maybe a simple proxy config doesn't work and it needs other options? And of course, all I find are videos where people have it working, not any that show how to configure it :-) Google searching that error specifically brings me down a rabbit hole of node.js and react.js issues that don't seem to apply in my case. I did install certbot and got a TLS certificate installed from our ACME providor, but I don't think that is the issue. Without forcing 80->443, nginx should still proxy 80->8080, but that gives the same error.
Thanks for any help, tips or leads on how to solve this! I actually just built a second server following the same instructions and again, Zabbix is working great, just can't get the proxy configured to wrap it up in TLS!
-Nick
I currently have Zabbix 6.0 LTS running (Rocky Linux 8, nginx and PostgreSQL) just fine on a basic install. The Zabbix web interface is running at https://zabsvr.fqdn.tld:8080 and working fine with monitoring and alerting via email. I don't have local SSL cert expire checking working, but that's another story.
What I want to do is proxy the port 8080 web page, so users connect to https://zabsvr.fqdn.tld/zabbix instead of http://zabsvrfqdn.tld:8080. Since I'm already using Nginx, this SHOULD have been a quick change. Unfortunately, I ran into a problem. What I did was enter the very simple config below into nginx.conf under the server section.
location /zabbix {
proxy_pass http://zabsvr.fqdn.tld:8080/;
}
I get a login screen, but logging in gives a 404 error. The error in /var/log/nginx/error.log is this.
2023/03/24 17:26:05 [error] 11299#0: *769 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.10.10.9, server: zabsvr.fqdn.tld, request: "POST /index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "zabsvr.fqdn.tld", referrer: "https://zabsvr.fqdn.tld/zabbix"
10.10.10.9 is the ip of the server, not the client I am running a browser on. I'm not sure if I need to edit something in zabbix.conf, php.conf or nginx.conf at this point, but I have my doubts that its an nginx thing but maybe a simple proxy config doesn't work and it needs other options? And of course, all I find are videos where people have it working, not any that show how to configure it :-) Google searching that error specifically brings me down a rabbit hole of node.js and react.js issues that don't seem to apply in my case. I did install certbot and got a TLS certificate installed from our ACME providor, but I don't think that is the issue. Without forcing 80->443, nginx should still proxy 80->8080, but that gives the same error.
Thanks for any help, tips or leads on how to solve this! I actually just built a second server following the same instructions and again, Zabbix is working great, just can't get the proxy configured to wrap it up in TLS!
-Nick
Comment