S
S
speedvm2020-03-12 08:47:56
Nginx
speedvm, 2020-03-12 08:47:56

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;
  }
}

Added the line "10.0.0.3 zabbix" to /etc/hosts.

When accessing zabbix in a browser , zabbix/setup.php opens ( start page of initial settings). Clicking on the "next step" button brings up the second page, but clicking on the "next step" of the second page opens the first page. The "next step" buttons cycle through the first and second pages. Is this possible or not possible?

PS: I beg the questions “What do you need it for?”, “You need to do more than that ..?” etc. leave to yourself.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
speedvm, 2020-03-12
@speedvm

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;
  }
}

A
anikavoi, 2020-03-12
@anikavoi

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/;

Try

F
fdroid, 2020-03-12
@fdroid

server {
    listen 80;
    server_name zabbix;
 
location / {
    proxy_pass http://10.0.0.2/zabbix;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question