Answer the question
In order to leave comments, you need to log in
How to configure nginx as proxy to zabbix web face?
Good day to all!
Get down to business! The zabbix server is 10.0.0.2, the nginx server is 10.0.0.3. The zabbix and nginx servers are installed from scratch. Access to zabbix is 10.0.0.2/zabbix, this opens the initial zabbix setup ( 10.0.0.2/zabbix/setup.php).
I configure nginx:
server {
listen 80;
server_name zabbix;
location / {
proxy_pass http://10.0.0.2/zabbix/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Answer the question
In order to leave comments, you need to log in
I don't know how correct this solution is, but:
server {
listen 80;
server_name zabbix;
location = / {
rewrite ^ /zabbix/ redirect;
}
location /zabbix/ {
proxy_pass http://10.0.0.2/zabbix/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
sub_filter /zabbix/ /;
sub_filter_once off;
rewrite ^/zabbix/(.*)$ /$1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://10.0.0.2/zabbix/;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question